summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-16 19:19:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-16 19:19:36 +0000
commit47e3f4e1aed4b71816e05fe608e97c523ea7ccfd (patch)
tree145cbe280c365e3248891cb484b6e12263bef7cd /thread_pthread.c
parentaba40d1a3897c56056ffc7ec96957c38b6b9fce8 (diff)
* 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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 4787823b3d..029ad43002 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -493,9 +493,8 @@ ubf_select(void *ptr)
#endif
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;
struct timespec ts;
struct timeval tvn;
@@ -509,15 +508,6 @@ native_sleep(rb_thread_t *th, struct timeval *tv, int deadlockable)
}
}
- if (!tv && deadlockable) {
- th->status = THREAD_STOPPED_FOREVER;
- th->vm->sleeper++;
- rb_check_deadlock(th->vm);
- }
- else {
- th->status = THREAD_STOPPED;
- }
-
thread_debug("native_sleep %ld\n", tv ? tv->tv_sec : -1);
GVL_UNLOCK_BEGIN();
{
@@ -555,9 +545,6 @@ native_sleep(rb_thread_t *th, struct timeval *tv, int deadlockable)
pthread_mutex_unlock(&th->interrupt_lock);
}
GVL_UNLOCK_END();
- th->status = prev_status;
- if (!tv && deadlockable) th->vm->sleeper--;
- RUBY_VM_CHECK_INTS();
thread_debug("native_sleep done\n");
}