1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/library/conditionvariable
normal 647fc1227a thread_sync.c (rb_mutex_synchronize): only unlock if we own the mutex
If an exception is raised inside Mutex#sleep (via ConditionVariable#wait),
we cannot guarantee we can own the mutex in the ensure callback.

However, who owns the mutex at that point does not matter.  What
matters is the Mutex is usable after an exception occurs.

* thread_sync.c (rb_mutex_synchronize): only unlock if we own the mutex

* spec/ruby/library/conditionvariable/wait_spec.rb: only test lock
  usability after thread kill.  Who owns the lock at any
  particular moment is an implementation detail which we cannot
  easily guarantee.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18 06:33:49 +00:00
..
broadcast_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
marshal_dump_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
signal_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
wait_spec.rb thread_sync.c (rb_mutex_synchronize): only unlock if we own the mutex 2018-08-18 06:33:49 +00:00