* thread_pthread.c: Fixes wrong scopes of #if USE_SLEEPY_TIMER_THREAD
.. #endif sections. This fixes a build error on NativeClient. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
360edb1c04
commit
75b4c8f490
@ -1,3 +1,8 @@
|
|||||||
|
Thu Apr 4 16:51:29 2013 Yuki Yugui Sonoda <yugui@google.com>
|
||||||
|
|
||||||
|
* thread_pthread.c: Fixes wrong scopes of #if USE_SLEEPY_TIMER_THREAD
|
||||||
|
.. #endif sections. This fixes a build error on NativeClient.
|
||||||
|
|
||||||
Wed Apr 3 17:25:31 2013 Yuki Yugui Sonoda <yugui@google.com>
|
Wed Apr 3 17:25:31 2013 Yuki Yugui Sonoda <yugui@google.com>
|
||||||
|
|
||||||
* thread_pthread.c (ruby_init_stack): Avoid using uninitialized value.
|
* thread_pthread.c (ruby_init_stack): Avoid using uninitialized value.
|
||||||
|
@ -1241,7 +1241,6 @@ close_communication_pipe(int pipes[2])
|
|||||||
pipes[0] = pipes[1] = -1;
|
pipes[0] = pipes[1] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_SLEEPY_TIMER_THREAD
|
|
||||||
static void
|
static void
|
||||||
set_nonblock(int fd)
|
set_nonblock(int fd)
|
||||||
{
|
{
|
||||||
@ -1256,9 +1255,7 @@ set_nonblock(int fd)
|
|||||||
if (err == -1)
|
if (err == -1)
|
||||||
rb_sys_fail(0);
|
rb_sys_fail(0);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_SLEEPY_TIMER_THREAD
|
|
||||||
static void
|
static void
|
||||||
setup_communication_pipe_internal(int pipes[2])
|
setup_communication_pipe_internal(int pipes[2])
|
||||||
{
|
{
|
||||||
@ -1278,13 +1275,11 @@ setup_communication_pipe_internal(int pipes[2])
|
|||||||
set_nonblock(pipes[0]);
|
set_nonblock(pipes[0]);
|
||||||
set_nonblock(pipes[1]);
|
set_nonblock(pipes[1]);
|
||||||
}
|
}
|
||||||
#endif /* USE_SLEEPY_TIMER_THREAD */
|
|
||||||
|
|
||||||
/* communication pipe with timer thread and signal handler */
|
/* communication pipe with timer thread and signal handler */
|
||||||
static void
|
static void
|
||||||
setup_communication_pipe(void)
|
setup_communication_pipe(void)
|
||||||
{
|
{
|
||||||
#if USE_SLEEPY_TIMER_THREAD
|
|
||||||
if (timer_thread_pipe_owner_process == getpid()) {
|
if (timer_thread_pipe_owner_process == getpid()) {
|
||||||
/* already set up. */
|
/* already set up. */
|
||||||
return;
|
return;
|
||||||
@ -1294,7 +1289,6 @@ setup_communication_pipe(void)
|
|||||||
|
|
||||||
/* validate pipe on this process */
|
/* validate pipe on this process */
|
||||||
timer_thread_pipe_owner_process = getpid();
|
timer_thread_pipe_owner_process = getpid();
|
||||||
#endif /* USE_SLEEPY_TIMER_THREAD */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1349,6 +1343,7 @@ timer_thread_sleep(rb_global_vm_lock_t* gvl)
|
|||||||
#else /* USE_SLEEPY_TIMER_THREAD */
|
#else /* USE_SLEEPY_TIMER_THREAD */
|
||||||
# define PER_NANO 1000000000
|
# define PER_NANO 1000000000
|
||||||
void rb_thread_wakeup_timer_thread(void) {}
|
void rb_thread_wakeup_timer_thread(void) {}
|
||||||
|
static void rb_thread_wakeup_timer_thread_low(void) {}
|
||||||
|
|
||||||
static pthread_mutex_t timer_thread_lock;
|
static pthread_mutex_t timer_thread_lock;
|
||||||
static rb_thread_cond_t timer_thread_cond;
|
static rb_thread_cond_t timer_thread_cond;
|
||||||
@ -1431,7 +1426,9 @@ rb_thread_create_timer_thread(void)
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if USE_SLEEPY_TIMER_THREAD
|
||||||
setup_communication_pipe();
|
setup_communication_pipe();
|
||||||
|
#endif /* USE_SLEEPY_TIMER_THREAD */
|
||||||
|
|
||||||
/* create timer thread */
|
/* create timer thread */
|
||||||
if (timer_thread_id) {
|
if (timer_thread_id) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user