summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 15:04:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 15:04:39 +0000
commit9f13d28828b86a84ae946dbee23ddb4194a40f38 (patch)
treeddd36ba8bf5c2c2d59f2da16f9eb4938b6b7e96a
parentf5dd2cf3bab25e2d83502d21a4bf227efd5494bb (diff)
add tag v1_8_6_226v1_8_6_226
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_6_226@17440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--eval.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/eval.c b/eval.c
index 951676c875..da2eb5ae41 100644
--- a/eval.c
+++ b/eval.c
@@ -11808,18 +11808,13 @@ catch_timer(sig)
/* cause EINTR */
}
-static int time_thread_alive_p = 0;
static pthread_t time_thread;
static void*
thread_timer(dummy)
void *dummy;
{
-#ifdef _THREAD_SAFE
#define test_cancel() pthread_testcancel()
-#else
-#define test_cancel() /* void */
-#endif
sigset_t all_signals;
@@ -11865,21 +11860,18 @@ rb_thread_stop_timer()
void
rb_child_atfork()
{
- time_thread_alive_p = 0;
+ thread_init = 0;
}
void
rb_thread_cancel_timer()
{
-#ifdef _THREAD_SAFE
- if( time_thread_alive_p )
+ if (thread_init)
{
- pthread_cancel( time_thread );
- pthread_join( time_thread, NULL );
- time_thread_alive_p = 0;
+ pthread_cancel(time_thread);
+ pthread_join(time_thread, NULL);
}
thread_init = 0;
-#endif
}
#elif defined(HAVE_SETITIMER)
static void
@@ -11923,7 +11915,6 @@ void
rb_thread_cancel_timer()
{
}
-
#else /* !(_THREAD_SAFE || HAVE_SETITIMER) */
int rb_thread_tick = THREAD_TICK;
@@ -11961,7 +11952,6 @@ rb_thread_start_0(fn, arg, th)
#ifdef _THREAD_SAFE
pthread_create(&time_thread, 0, thread_timer, 0);
- time_thread_alive_p = 1;
pthread_atfork(0, 0, rb_child_atfork);
#else
rb_thread_start_timer();