* signal.c (rb_signal_buff_size): defined for check whether signal
is in the buffer or not. * thread_pthread.c (thread_timer): don't exit the loop when signal is in the buffer. [ruby-dev:37637] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
28c2711230
commit
d4b3e8ae70
@ -1,3 +1,11 @@
|
|||||||
|
Fri Jan 2 06:43:58 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* signal.c (rb_signal_buff_size): defined for check whether signal
|
||||||
|
is in the buffer or not.
|
||||||
|
|
||||||
|
* thread_pthread.c (thread_timer): don't exit the loop when signal
|
||||||
|
is in the buffer. [ruby-dev:37637]
|
||||||
|
|
||||||
Fri Jan 2 04:40:00 2009 Tanaka Akira <akr@fsij.org>
|
Fri Jan 2 04:40:00 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/mkconstants.rb: check duplicates.
|
* ext/socket/mkconstants.rb: check duplicates.
|
||||||
|
6
signal.c
6
signal.c
@ -514,6 +514,12 @@ sighandler(int sig)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
rb_signal_buff_size()
|
||||||
|
{
|
||||||
|
return signal_buff.size;
|
||||||
|
}
|
||||||
|
|
||||||
#if USE_TRAP_MASK
|
#if USE_TRAP_MASK
|
||||||
# ifdef HAVE_SIGPROCMASK
|
# ifdef HAVE_SIGPROCMASK
|
||||||
static sigset_t trap_last_mask;
|
static sigset_t trap_last_mask;
|
||||||
|
@ -741,19 +741,24 @@ get_ts(struct timespec *ts, unsigned long nsec)
|
|||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int rb_signal_buff_size(void);
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
thread_timer(void *dummy)
|
thread_timer(void *dummy)
|
||||||
{
|
{
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
int err;
|
|
||||||
|
|
||||||
native_mutex_lock(&timer_thread_lock);
|
native_mutex_lock(&timer_thread_lock);
|
||||||
native_cond_broadcast(&timer_thread_cond);
|
native_cond_broadcast(&timer_thread_cond);
|
||||||
#define WAIT_FOR_10MS() native_cond_timedwait(&timer_thread_cond, &timer_thread_lock, get_ts(&ts, PER_NANO/100))
|
#define WAIT_FOR_10MS() native_cond_timedwait(&timer_thread_cond, &timer_thread_lock, get_ts(&ts, PER_NANO/100))
|
||||||
while (system_working > 0 && (err = WAIT_FOR_10MS()) != 0 && err != EINTR) {
|
while (system_working > 0) {
|
||||||
if (err != ETIMEDOUT) {
|
int err = WAIT_FOR_10MS();
|
||||||
rb_bug("thread_timer/timedwait: %d", err);
|
if (err == ETIMEDOUT);
|
||||||
|
else if (err == 0 || err == EINTR) {
|
||||||
|
if (rb_signal_buff_size() == 0) break;
|
||||||
}
|
}
|
||||||
|
else rb_bug("thread_timer/timedwait: %d", err);
|
||||||
|
|
||||||
#ifndef __CYGWIN__
|
#ifndef __CYGWIN__
|
||||||
if (signal_thread_list_anchor.next) {
|
if (signal_thread_list_anchor.next) {
|
||||||
FGLOCK(&signal_thread_list_lock, {
|
FGLOCK(&signal_thread_list_lock, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user