Skip to content

Commit b5546cb

Browse files
committed
Remove _monitorsMutex in favor of postVMEvent()
* Much simpler, the caller is always the thread running the VM.
1 parent 91b203f commit b5546cb

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

vm/boostenv/main/boostvm-decl.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ private:
172172
// Monitors
173173
private:
174174
std::vector<VMIdentifier> _monitors;
175-
boost::mutex _monitorsMutex;
176175

177176
// Termination
178177
private:

vm/boostenv/main/boostvm.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,10 @@ UnstableNode BoostVM::buildTerminationRecord(VMIdentifier deadVM, const std::str
281281
}
282282

283283
void BoostVM::addMonitor(VMIdentifier monitor) {
284-
boost::lock_guard<boost::mutex> lock(_monitorsMutex);
285284
_monitors.push_back(monitor);
286285
}
287286

288287
void BoostVM::notifyMonitors() {
289-
boost::lock_guard<boost::mutex> lock(_monitorsMutex);
290288
VMIdentifier deadVM = this->identifier;
291289
std::string reason = this->_terminationReason;
292290
for (VMIdentifier identifier : _monitors) {

vm/boostenv/main/modvm.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public:
177177
if (identifier == monitor)
178178
raiseError(vm, buildTuple(vm, "vm", "cannotMonitorItself"));
179179

180-
bool found = env.findVM(identifier, [monitor] (BoostVM& monitoredVM) {
180+
bool found = env.postVMEvent(identifier, [monitor] (BoostVM& monitoredVM) {
181181
monitoredVM.addMonitor(monitor);
182182
});
183183
if (!found) {

0 commit comments

Comments
 (0)