summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--thread.c1
-rw-r--r--thread_pthread.c2
-rw-r--r--thread_win32.c1
4 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 15d4f2c..e8d3a09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* encoding.c (rb_enc_name_list_i, rb_enc_aliases_enc_i): freeze
diff --git a/thread.c b/thread.c
index 7326c59..e45062c 100644
--- a/thread.c
+++ b/thread.c
@@ -281,7 +281,6 @@ thread_cleanup_func(void *th_ptr)
#ifdef __ia64
th->machine_register_stack_start = th->machine_register_stack_end = 0;
#endif
- native_mutex_destroy(&th->interrupt_lock);
native_thread_destroy(th);
}
diff --git a/thread_pthread.c b/thread_pthread.c
index 202dc54..62bddb7 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -13,7 +13,6 @@
static void native_mutex_lock(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 void native_mutex_initialize(pthread_mutex_t *lock);
static void native_mutex_destroy(pthread_mutex_t *lock);
@@ -156,6 +155,7 @@ Init_native_thread(void)
static void
native_thread_destroy(rb_thread_t *th)
{
+ pthread_mutex_destroy(&th->interrupt_lock);
pthread_cond_destroy(&th->native_thread_data.sleep_cond);
}
diff --git a/thread_win32.c b/thread_win32.c
index 7c4f402..7680a22 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -418,6 +418,7 @@ static void
native_thread_destroy(rb_thread_t *th)
{
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);
th->native_thread_data.interrupt_event = 0;
w32_close_handle(intr);