aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-22 06:17:15 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-22 06:17:15 +0000
commit3fdee943cc950932533edde3f24a85e0402c3e18 (patch)
tree1ad0333389067735124566356f977ee49deef164 /thread.c
parent7392c4ac5b664484d2309c9b0b9b6ab4e4d0e065 (diff)
downloadruby-3fdee943cc950932533edde3f24a85e0402c3e18.tar.gz
thread.c (sleep_timespec): avoid needless update w/o spuriuos check
No point in wasting cycles updating the timespec when not checking on spurious wakeups. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index db7f28c8fb..5a5e32379d 100644
--- a/thread.c
+++ b/thread.c
@@ -1271,10 +1271,10 @@ sleep_timespec(rb_thread_t *th, struct timespec ts, unsigned int fl)
while (th->status == THREAD_STOPPED) {
native_sleep(th, &ts);
RUBY_VM_CHECK_INTS_BLOCKING(th->ec);
- if (timespec_update_expire(&ts, &end))
- break;
if (!(fl & SLEEP_SPURIOUS_CHECK))
break;
+ if (timespec_update_expire(&ts, &end))
+ break;
}
th->status = prev_status;
}