diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-18 06:33:49 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-18 06:33:49 +0000 |
commit | 647fc1227a4146ecbfeb0d59358abc8d99cd8ae6 (patch) | |
tree | a5c9bd35aaf8ca67b4ff3f27b56726f8a63cca05 /rubystub.c | |
parent | 6e0d69e4a72c7a9d9cf5172bd9b74633d7259f9d (diff) | |
download | ruby-647fc1227a4146ecbfeb0d59358abc8d99cd8ae6.tar.gz |
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
Diffstat (limited to 'rubystub.c')
0 files changed, 0 insertions, 0 deletions