diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-20 00:07:19 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-20 00:07:19 +0000 |
commit | 0b38221d4ea75d8ac96b2adb1f7fafb0b20f9d29 (patch) | |
tree | 3f9e432e5819a1ca767720ca5886f604e067e0b4 /enc/encinit.c.erb | |
parent | cb3393add588ba14f95449515d5fe75eb8eada27 (diff) | |
download | ruby-0b38221d4ea75d8ac96b2adb1f7fafb0b20f9d29.tar.gz |
thread_pthread.c (ubf_timer_disarm): ignore EINVAL iff timer is dead
The following race may happen if ubf_timer_destroy calls
timer_delete before ubf_timer_disarm gets called from
a different thread. Consider the following timelines:
ubf_timer_destroy | ubf_timer_disarm
-------------------------------------+-----------------------------
| CAS(ARM => DISARM)
CAS(DISARM => DEAD) |
timer_delete |
| timer_settime(disarm)
Another option may be to add an intermediate "RTIMER_DISARMING"
state to the transition, but I figure the EINVAL check is
simpler and less intrusive code-wise.
cf. http://ci.rvm.jp/results/trunk-iseq_binary@silicon-docker/1545794
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/encinit.c.erb')
0 files changed, 0 insertions, 0 deletions