Skip to content

Commit

Permalink
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions machine/thread_nexus.cpp
Original file line number Diff line number Diff line change
@@ -205,21 +205,21 @@ namespace rubinius {
id = 0;
}

/* Lock and hold the waiting_mutex to prevent any other thread from
* holding it across a fork() call.
*/
// Checkpoint all the other threads.
ns = 0;

while(!waiting_mutex_.try_lock()) {
while(!try_checkpoint(vm)) {
ns += delay();

detect_deadlock(ns, lock_limit);
}

// Checkpoint all the other threads.
/* Lock and hold the waiting_mutex to prevent any other thread from
* holding it across a fork() call.
*/
ns = 0;

while(!try_checkpoint(vm)) {
while(!waiting_mutex_.try_lock()) {
ns += delay();

detect_deadlock(ns, lock_limit);
2 changes: 1 addition & 1 deletion machine/thread_nexus.hpp
Original file line number Diff line number Diff line change
@@ -157,8 +157,8 @@ namespace rubinius {

void unlock() {
std::lock_guard<std::mutex> guard(waiting_mutex_);
phase_flag_ = 0;
waiting_condition_.notify_all();
phase_flag_ = 0;
}

bool try_checkpoint(VM* vm);

0 comments on commit 1f65038

Please sign in to comment.