ruby-changes:53432
From: normal <ko1@a...>
Date: Sat, 10 Nov 2018 08:24:18 +0900 (JST)
Subject: [ruby-changes:53432] normal:r65648 (trunk): thread_pthread.c (rb_sigwait_sleep): add note about spurious wakeup
normal 2018-11-10 08:24:14 +0900 (Sat, 10 Nov 2018) New Revision: 65648 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65648 Log: 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] Modified files: trunk/thread_pthread.c Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 65647) +++ thread_pthread.c (revision 65648) @@ -1981,6 +1981,9 @@ rb_sigwait_sleep(rb_thread_t *th, int si https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1981 * 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/