diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-07 16:42:31 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-07 16:42:31 +0000 |
| commit | dbce5d4065124edec0b1a9961d262a304ff88f33 (patch) | |
| tree | 7e86f829b97ddf3a530354d4d2a76d8da8ba5ed1 | |
| parent | d9a18036799877a27b10eac38b78fbceeebebca1 (diff) | |
| download | ruby-dbce5d4065124edec0b1a9961d262a304ff88f33.tar.gz ruby-dbce5d4065124edec0b1a9961d262a304ff88f33.tar.xz ruby-dbce5d4065124edec0b1a9961d262a304ff88f33.zip | |
* thread_pthread.c (native_cond_timedwait): returns error code.
* thread_pthread.c (thread_timer): typo fixed.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | thread_pthread.c | 8 |
2 files changed, 10 insertions, 4 deletions
@@ -1,3 +1,9 @@ +Sat Nov 8 01:42:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * thread_pthread.c (native_cond_timedwait): returns error code. + + * thread_pthread.c (thread_timer): typo fixed. + Sat Nov 8 01:14:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * thread_pthread.c (thread_timer, rb_thread_create_timer_thread): diff --git a/thread_pthread.c b/thread_pthread.c index 67ad3b08a..46a86192e 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -116,10 +116,10 @@ native_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) pthread_cond_wait(cond, mutex); } -static void +static int native_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *ts) { - pthread_cond_timedwait(cond, mutex, ts); + return pthread_cond_timedwait(cond, mutex, ts); } @@ -680,8 +680,8 @@ thread_timer(void *dummy) native_mutex_lock(&timer_thread_lock); native_cond_signal(&timer_thread_cond); -#define WAIT_FOR_10MS() native_cond_timedwait(&timer_thread_cond, &timer_thread_lock, get_ts(&ts, PER_NANO/100) - while ((err = WAIT_FOR_10MS()) != 0) { +#define WAIT_FOR_10MS() native_cond_timedwait(&timer_thread_cond, &timer_thread_lock, get_ts(&ts, PER_NANO/100)) + while ((err = WAIT_FOR_10MS()) != 0 && err != EINTR) { if (err != ETIMEDOUT) { rb_bug("thread_timer/timedwait: %d", err); } |
