1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

fix incorrect native_cond_signal call when deadlock was detected.

* thread.c (lock_func): timedwait don't touch cond_waiting and
  cond_notifid variables.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2011-05-07 06:20:39 +00:00
parent 94e4d61bda
commit fa319c5774
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Sat May 7 15:18:06 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
fix incorrect native_cond_signal call when deadlock was detected.
* thread.c (lock_func): timedwait don't touch cond_waiting and
cond_notifid variables.
Sat May 7 15:15:10 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
fix win32 native_cond_timedwait() makes SIGSEGV.

View file

@ -3423,7 +3423,6 @@ lock_func(rb_thread_t *th, mutex_t *mutex, int timeout_ms)
break;
}
mutex->cond_waiting++;
if (timeout_ms) {
int ret;
struct timespec timeout_rel;
@ -3439,9 +3438,10 @@ lock_func(rb_thread_t *th, mutex_t *mutex, int timeout_ms)
}
}
else {
mutex->cond_waiting++;
native_cond_wait(&mutex->cond, &mutex->lock);
mutex->cond_notified--;
}
mutex->cond_notified--;
if (RUBY_VM_INTERRUPTED(th)) {
interrupted = 1;