diff options
author | Dick Porter <dick@acm.org> | 2004-07-22 23:28:43 +0400 |
---|---|---|
committer | Dick Porter <dick@acm.org> | 2004-07-22 23:28:43 +0400 |
commit | 773b2953ed60e589650a554f78a090c7bd89ffe3 (patch) | |
tree | 2437d305399c1d5140c14ac13e676753bca33679 | |
parent | 742f90127f7e16d9d3bbb67445afaab535613493 (diff) |
2004-07-22 Dick Porter <dick@ximian.com>
* timed-thread.c:
* threads.c: Move the destruction of the internal thread data to
after the thread has been joined. Fixes bug 61418.
svn path=/branches/mono-1-0/mono/; revision=31387
-rw-r--r-- | mono/io-layer/ChangeLog | 6 | ||||
-rw-r--r-- | mono/io-layer/threads.c | 12 | ||||
-rw-r--r-- | mono/io-layer/timed-thread.c | 2 |
3 files changed, 17 insertions, 3 deletions
diff --git a/mono/io-layer/ChangeLog b/mono/io-layer/ChangeLog index ef6a7453600..fec9ca9fbe0 100644 --- a/mono/io-layer/ChangeLog +++ b/mono/io-layer/ChangeLog @@ -1,3 +1,9 @@ +2004-07-22 Dick Porter <dick@ximian.com> + + * timed-thread.c: + * threads.c: Move the destruction of the internal thread data to + after the thread has been joined. Fixes bug 61418. + 2004-07-14 Dick Porter <dick@ximian.com> * wait.c (test_and_own): When not waiting for all handles to diff --git a/mono/io-layer/threads.c b/mono/io-layer/threads.c index b9ddc6aa3dc..31c1176a12c 100644 --- a/mono/io-layer/threads.c +++ b/mono/io-layer/threads.c @@ -99,9 +99,7 @@ static void thread_close_private (gpointer handle) thread_handle->thread->id); #endif - if(thread_handle->thread!=NULL) { - _wapi_timed_thread_destroy (thread_handle->thread); - } + thread_handle->thread=NULL; } static void thread_own (gpointer handle) @@ -628,6 +626,10 @@ guint32 ResumeThread(gpointer handle) return(0xFFFFFFFF); } + if (thread_private_handle->thread == NULL) { + return(0xFFFFFFFF); + } + #ifdef WITH_INCLUDED_LIBGC if (thread_private_handle->thread->suspend_count <= 1) _wapi_timed_thread_resume (thread_private_handle->thread); @@ -670,6 +672,10 @@ guint32 SuspendThread(gpointer handle) return(0xFFFFFFFF); } + if (thread_private_handle->thread == NULL) { + return(0xFFFFFFFF); + } + if (!thread_private_handle->thread->suspend_count) { if (handle == current) _wapi_timed_thread_suspend (thread_private_handle->thread); diff --git a/mono/io-layer/timed-thread.c b/mono/io-layer/timed-thread.c index c0d737862a2..6599e0660f3 100644 --- a/mono/io-layer/timed-thread.c +++ b/mono/io-layer/timed-thread.c @@ -254,6 +254,8 @@ int _wapi_timed_thread_join(TimedThread *thread, struct timespec *timeout, if(exitstatus!=NULL) { *exitstatus = thread->exitstatus; } + + _wapi_timed_thread_destroy (thread); } return(result); } |