1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* thread.c (thread_cleanup_func): ignore errors from destroying mutex

of dead thread.  [ruby-core:15069]

* thread_pthread.c, thread_win32.c (native_thread_destroy): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-01-18 06:57:08 +00:00
parent b66eb53650
commit 3a4bfbad09
4 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,10 @@
Fri Jan 18 15:57:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread.c (thread_cleanup_func): ignore errors from destroying mutex
of dead thread. [ruby-core:15069]
* thread_pthread.c, thread_win32.c (native_thread_destroy): ditto.
Fri Jan 18 15:56:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Fri Jan 18 15:56:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (rb_enc_name_list_i, rb_enc_aliases_enc_i): freeze * encoding.c (rb_enc_name_list_i, rb_enc_aliases_enc_i): freeze

View file

@ -281,7 +281,6 @@ thread_cleanup_func(void *th_ptr)
#ifdef __ia64 #ifdef __ia64
th->machine_register_stack_start = th->machine_register_stack_end = 0; th->machine_register_stack_start = th->machine_register_stack_end = 0;
#endif #endif
native_mutex_destroy(&th->interrupt_lock);
native_thread_destroy(th); native_thread_destroy(th);
} }

View file

@ -13,7 +13,6 @@
static void native_mutex_lock(pthread_mutex_t *lock); static void native_mutex_lock(pthread_mutex_t *lock);
static void native_mutex_unlock(pthread_mutex_t *lock); static void native_mutex_unlock(pthread_mutex_t *lock);
static void native_mutex_destroy(pthread_mutex_t *lock);
static int native_mutex_trylock(pthread_mutex_t *lock); static int native_mutex_trylock(pthread_mutex_t *lock);
static void native_mutex_initialize(pthread_mutex_t *lock); static void native_mutex_initialize(pthread_mutex_t *lock);
static void native_mutex_destroy(pthread_mutex_t *lock); static void native_mutex_destroy(pthread_mutex_t *lock);
@ -156,6 +155,7 @@ Init_native_thread(void)
static void static void
native_thread_destroy(rb_thread_t *th) native_thread_destroy(rb_thread_t *th)
{ {
pthread_mutex_destroy(&th->interrupt_lock);
pthread_cond_destroy(&th->native_thread_data.sleep_cond); pthread_cond_destroy(&th->native_thread_data.sleep_cond);
} }

View file

@ -418,6 +418,7 @@ static void
native_thread_destroy(rb_thread_t *th) native_thread_destroy(rb_thread_t *th)
{ {
HANDLE intr = th->native_thread_data.interrupt_event; HANDLE intr = th->native_thread_data.interrupt_event;
native_mutex_destroy(&th->interrupt_lock);
thread_debug("close handle - intr: %p, thid: %p\n", intr, th->thread_id); thread_debug("close handle - intr: %p, thid: %p\n", intr, th->thread_id);
th->native_thread_data.interrupt_event = 0; th->native_thread_data.interrupt_event = 0;
w32_close_handle(intr); w32_close_handle(intr);