Skip to content

Commit

Permalink
Fix deadlock issue in signal handling of sleeping threads
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Feb 6, 2013
1 parent 5a1b06e commit d8fcda5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vm/park.cpp
Expand Up @@ -18,10 +18,13 @@ namespace rubinius {

cond_.wait(mutex_);
}
mutex_.unlock();
if(!state->check_async(call_frame)) {
mutex_.lock();
result = NULL;
break;
}
mutex_.lock();
}

sleeping_ = false;
Expand Down Expand Up @@ -49,10 +52,13 @@ namespace rubinius {
break;
}
}
mutex_.unlock();
if(!state->check_async(call_frame)) {
mutex_.lock();
timeout = NULL;
break;
}
mutex_.lock();
}

sleeping_ = false;
Expand Down

0 comments on commit d8fcda5

Please sign in to comment.