From f8eafacea311d9dc6162f4ee14ba7c3c9d52c765 Mon Sep 17 00:00:00 2001 From: Jonathan Chambers Date: Wed, 9 May 2007 18:21:37 +0000 Subject: [PATCH] 2007-05-09 Jonathan Chambers * win32_threads.c: If SuspendThread fails, don't abort. Instead remove thread from GC, as this only seems to happen when thread is terminating. svn path=/trunk/mono/; revision=77073 --- ChangeLog | 6 ++++++ win32_threads.c | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1de02cb..70d44fe5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-05-09 Jonathan Chambers + + * win32_threads.c: If SuspendThread fails, don't abort. Instead + remove thread from GC, as this only seems to happen when thread is + terminating. + 2007-03-29 Zoltan Varga * autogen.sh: Applied patch from Priit Laes . Fix the running diff --git a/win32_threads.c b/win32_threads.c index 87944dc3..a9569c83 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -283,8 +283,15 @@ void GC_stop_world() # endif continue; } - if (SuspendThread(thread_table[i].handle) == (DWORD)-1) - ABORT("SuspendThread failed"); + if (SuspendThread(thread_table[i].handle) == (DWORD)-1) { + thread_table[i].stack_base = 0; /* prevent stack from being pushed */ +# ifndef CYGWIN32 + /* this breaks pthread_join on Cygwin, which is guaranteed to */ + /* only see user pthreads */ + thread_table[i].in_use = FALSE; + CloseHandle(thread_table[i].handle); +# endif + } # endif thread_table[i].suspended = TRUE; } -- 2.40.0