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

* ext/thread/thread.c (unlock_mutex_inner): Make sure that the

given mutex is actually owned by the caller; submitted by:
  Sylvain Joyeux <sylvain.joyeux AT m4x.org> in [ruby-core:10598].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2007-03-16 07:36:08 +00:00
parent 15b97d196a
commit 5f4b6b984a
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Fri Mar 16 16:33:58 2007 Akinori MUSHA <knu@iDaemons.org>
* ext/thread/thread.c (unlock_mutex_inner): Make sure that the
given mutex is actually owned by the caller; submitted by:
Sylvain Joyeux <sylvain.joyeux AT m4x.org> in [ruby-core:10598].
Fri Mar 16 16:21:35 2007 Akinori MUSHA <knu@iDaemons.org>
* ext/thread/thread.c (wait_condvar, lock_mutex): Fix a problem in

View file

@ -430,8 +430,13 @@ unlock_mutex_inner(Mutex *mutex)
VALUE waking;
if (!RTEST(mutex->owner)) {
return Qundef;
rb_raise(rb_eThreadError, "not owner");
}
if (mutex->owner != rb_thread_current()) {
rb_raise(rb_eThreadError, "not owner");
}
mutex->owner = Qnil;
waking = wake_one(&mutex->waiting);