summaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-07 13:42:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-07 13:42:36 +0000
commite7766df532b56b5ac35a5b87a0068a8ea2a4953f (patch)
treee267bfe8343c6b4535943009e6e725e3c0dde18e /thread_pthread.c
parentff24e479c2c54095d1d2542fa9b504175d628004 (diff)
downloadruby-e7766df532b56b5ac35a5b87a0068a8ea2a4953f.tar.gz
ruby-e7766df532b56b5ac35a5b87a0068a8ea2a4953f.tar.xz
ruby-e7766df532b56b5ac35a5b87a0068a8ea2a4953f.zip
* thread_pthread.c (thread_timer): initializes mutex each time.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index e73879119..c49efb338 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()) {