mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
64a189d207
commit
3839734b94
1 changed files with 2 additions and 2 deletions
4
thread.c
4
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue