mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Distinguish signal and timeout [Bug #16608]
This commit is contained in:
parent
8897098b5c
commit
070557afc4
Notes:
git
2021-07-26 05:09:31 +09:00
5 changed files with 24 additions and 14 deletions
6
thread.c
6
thread.c
|
@ -132,7 +132,7 @@ rb_thread_local_storage(VALUE thread)
|
|||
return rb_ivar_get(thread, idLocals);
|
||||
}
|
||||
|
||||
static void sleep_hrtime(rb_thread_t *, rb_hrtime_t, unsigned int fl);
|
||||
static int sleep_hrtime(rb_thread_t *, rb_hrtime_t, unsigned int fl);
|
||||
static void sleep_forever(rb_thread_t *th, unsigned int fl);
|
||||
static void rb_thread_sleep_deadly_allow_spurious_wakeup(VALUE blocker);
|
||||
static int rb_threadptr_dead(rb_thread_t *th);
|
||||
|
@ -1479,7 +1479,7 @@ hrtime_update_expire(rb_hrtime_t *timeout, const rb_hrtime_t end)
|
|||
}
|
||||
COMPILER_WARNING_POP
|
||||
|
||||
static void
|
||||
static int
|
||||
sleep_hrtime(rb_thread_t *th, rb_hrtime_t rel, unsigned int fl)
|
||||
{
|
||||
enum rb_thread_status prev_status = th->status;
|
||||
|
@ -1495,8 +1495,10 @@ sleep_hrtime(rb_thread_t *th, rb_hrtime_t rel, unsigned int fl)
|
|||
break;
|
||||
if (hrtime_update_expire(&rel, end))
|
||||
break;
|
||||
woke = 1;
|
||||
}
|
||||
th->status = prev_status;
|
||||
return woke;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue