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:
parent
15b97d196a
commit
5f4b6b984a
2 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue