path: root/thread_pthread.c
diff options
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-09 23:24:14 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-09 23:24:14 (GMT)
commit62c69768ba0139721eff923cb8031db1a6049e92 (patch)
tree5fd9cd328ff8b8c11adddb3ae9eadbf74cdc1241 /thread_pthread.c
parent4bf84ede2013a69dba2b89080211e9aa59a533d5 (diff)
thread_pthread.c (rb_sigwait_sleep): add note about spurious wakeup
I already forgot why we needed to jump through such hoops :x [ruby-core:88102] git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
1 files changed, 3 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index aa5fe66..1f2ac00 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1981,6 +1981,9 @@ rb_sigwait_sleep(rb_thread_t *th, int sigwait_fd, const rb_hrtime_t *rel)
* tricky: this needs to return on spurious wakeup (no auto-retry).
* But we also need to distinguish between periodic quantum
* wakeups, so we care about the result of consume_communication_pipe
+ *
+ * We want to avoid spurious wakeup for Mutex#sleep compatibility
+ * [ruby-core:88102]
for (;;) {
const rb_hrtime_t *sto = sigwait_timeout(th, sigwait_fd, &to, &n);