1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* thread.c (thread_start_func_2): wake up joining threads.

* thread.c (sleep_forever, sleep_timeval): return when interrupted.
  [ruby-dev:35542]

* thread.c (timer_thread_function): restore main thread status.
  [ruby-core:17270]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-07-16 19:19:36 +00:00
parent aba40d1a38
commit 47e3f4e1ae
4 changed files with 73 additions and 58 deletions

View file

@ -204,9 +204,8 @@ rb_w32_Sleep(unsigned long msec)
}
static void
native_sleep(rb_thread_t *th, struct timeval *tv, int deadlockable)
native_sleep(rb_thread_t *th, struct timeval *tv)
{
int prev_status = th->status;
DWORD msec;
if (tv) {
@ -216,15 +215,6 @@ native_sleep(rb_thread_t *th, struct timeval *tv, int deadlockable)
msec = INFINITE;
}
if (!tv && deadlockable) {
th->status = THREAD_STOPPED_FOREVER;
th->vm->sleeper++;
rb_check_deadlock(th->vm);
}
else {
th->status = THREAD_STOPPED;
}
GVL_UNLOCK_BEGIN();
{
DWORD ret;
@ -249,9 +239,6 @@ native_sleep(rb_thread_t *th, struct timeval *tv, int deadlockable)
native_mutex_unlock(&th->interrupt_lock);
}
GVL_UNLOCK_END();
th->status = prev_status;
if (!tv && deadlockable) th->vm->sleeper--;
RUBY_VM_CHECK_INTS();
}
static int