diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-14 02:26:20 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-14 02:26:20 +0000 |
commit | 23f9e7460462efa9273c05b8c616ca9dfa6e24af (patch) | |
tree | e99d2c6ac551cb9a4942d7f059b09a08a85c30a2 /thread_pthread.c | |
parent | 24c376662401a2d9886d63423ddfb72d697747fb (diff) | |
download | ruby-23f9e7460462efa9273c05b8c616ca9dfa6e24af.tar.gz |
* thread_pthread.c (ubf_select): call rb_thread_wakeup_timer_thread()
only when it is not timer_thread. [Bug #5757] [ruby-dev:44985]
patched by Tomoyuki Chikanaga.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index afef326898..c1a76d70f2 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -38,6 +38,7 @@ static void native_cond_broadcast(rb_thread_cond_t *cond); static void native_cond_wait(rb_thread_cond_t *cond, pthread_mutex_t *mutex); static void native_cond_initialize(rb_thread_cond_t *cond, int flags); static void native_cond_destroy(rb_thread_cond_t *cond); +static pthread_t timer_thread_id; #define RB_CONDATTR_CLOCK_MONOTONIC 1 @@ -1018,7 +1019,8 @@ ubf_select(void *ptr) { rb_thread_t *th = (rb_thread_t *)ptr; add_signal_thread_list(th); - rb_thread_wakeup_timer_thread(); /* activate timer thread */ + if (pthread_self() != timer_thread_id) + rb_thread_wakeup_timer_thread(); /* activate timer thread */ ubf_select_each(th); } @@ -1047,7 +1049,6 @@ ping_signal_thread_list(void) { static int ping_signal_thread_list(void) { return 0; } #endif /* USE_SIGNAL_THREAD_LIST */ -static pthread_t timer_thread_id; static int timer_thread_pipe[2] = {-1, -1}; static int timer_thread_pipe_owner_process; |