* thread_{pthread,win32}.c (native_stop_timer_thread): join the thread
here. * thread_{pthread,win32}.c (native_reset_timer_thread): new function. * thread.c (rb_thread_stop_timer_thread, rb_thread_reset_timer_thread): call above function instead of simply seting 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7539e11a7f
commit
9ee5e613b5
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
Mon Nov 2 12:55:50 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* thread_{pthread,win32}.c (native_stop_timer_thread): join the thread
|
||||||
|
here.
|
||||||
|
|
||||||
|
* thread_{pthread,win32}.c (native_reset_timer_thread): new function.
|
||||||
|
|
||||||
|
* thread.c (rb_thread_stop_timer_thread, rb_thread_reset_timer_thread):
|
||||||
|
call above function instead of simply seting 0.
|
||||||
|
|
||||||
Mon Nov 2 11:22:19 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
Mon Nov 2 11:22:19 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* ext/dl/win32/lib/win32/registry.rb: update rdoc. [ruby-core:26022]
|
* ext/dl/win32/lib/win32/registry.rb: update rdoc. [ruby-core:26022]
|
||||||
|
5
thread.c
5
thread.c
@ -2651,15 +2651,14 @@ void
|
|||||||
rb_thread_stop_timer_thread(void)
|
rb_thread_stop_timer_thread(void)
|
||||||
{
|
{
|
||||||
if (timer_thread_id && native_stop_timer_thread()) {
|
if (timer_thread_id && native_stop_timer_thread()) {
|
||||||
native_thread_join(timer_thread_id);
|
native_reset_timer_thread();
|
||||||
timer_thread_id = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rb_thread_reset_timer_thread(void)
|
rb_thread_reset_timer_thread(void)
|
||||||
{
|
{
|
||||||
timer_thread_id = 0;
|
native_reset_timer_thread();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -816,9 +816,16 @@ native_stop_timer_thread(void)
|
|||||||
native_cond_signal(&timer_thread_cond);
|
native_cond_signal(&timer_thread_cond);
|
||||||
}
|
}
|
||||||
native_mutex_unlock(&timer_thread_lock);
|
native_mutex_unlock(&timer_thread_lock);
|
||||||
|
native_thread_join(timer_thread_id);
|
||||||
return stopped;
|
return stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
native_reset_timer_thread(void)
|
||||||
|
{
|
||||||
|
timer_thread_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SIGALTSTACK
|
#ifdef HAVE_SIGALTSTACK
|
||||||
int
|
int
|
||||||
ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr)
|
ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr)
|
||||||
|
@ -564,10 +564,21 @@ native_stop_timer_thread(void)
|
|||||||
{
|
{
|
||||||
int stopped = --system_working <= 0;
|
int stopped = --system_working <= 0;
|
||||||
if (stopped) {
|
if (stopped) {
|
||||||
|
SetEvent(timer_thread_lock);
|
||||||
|
native_thread_join(timer_thread_id);
|
||||||
CloseHandle(timer_thread_lock);
|
CloseHandle(timer_thread_lock);
|
||||||
timer_thread_lock = 0;
|
timer_thread_lock = 0;
|
||||||
}
|
}
|
||||||
return stopped;
|
return stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
native_reset_timer_thread(void)
|
||||||
|
{
|
||||||
|
if (timer_thread_id) {
|
||||||
|
CloseHandle(timer_thread_id);
|
||||||
|
timer_thread_id = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */
|
#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user