From 3899005d2ed7fc902df10e083f75d9f28a3d85eb Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 7 Nov 2008 13:42:36 +0000 Subject: * thread_pthread.c (thread_timer): initializes mutex each time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'thread_pthread.c') diff --git a/thread_pthread.c b/thread_pthread.c index e73879119a..c49efb3388 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -669,8 +669,9 @@ static void * thread_timer(void *dummy) { struct timespec ts; - static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + pthread_mutex_t lock; + pthread_mutex_initializer(&lock, 0); pthread_mutex_lock(&lock); #define WAIT_FOR_10MS() (pthread_cond_timedwait(&timer_thread_cond, &lock, get_ts(&ts, PER_NANO/100)) == ETIMEDOUT) while (WAIT_FOR_10MS()) { -- cgit v1.2.3