summaryrefslogtreecommitdiff
path: root/boehm-gc/win32_threads.c
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-25 03:03:14 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-25 03:03:14 +0000
commit8e86a8789d7a82b6f389c7c9052ba250933fafcb (patch)
tree575ef0143266ff2f57b09fe0143e9a412b1fb27f /boehm-gc/win32_threads.c
parent81aeb57750e78fcb33d69a741e75754851058883 (diff)
downloadgcc-8e86a8789d7a82b6f389c7c9052ba250933fafcb.tar.gz
Import Boehm GC version 6.6.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110204 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/win32_threads.c')
-rwxr-xr-x[-rw-r--r--]boehm-gc/win32_threads.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/boehm-gc/win32_threads.c b/boehm-gc/win32_threads.c
index 5604290de94..ba53d86fbd1 100644..100755
--- a/boehm-gc/win32_threads.c
+++ b/boehm-gc/win32_threads.c
@@ -11,6 +11,7 @@
# undef pthread_create
# undef pthread_sigmask
# undef pthread_join
+# undef pthread_detach
# undef dlopen
# define DEBUG_CYGWIN_THREADS 0
@@ -185,7 +186,7 @@ static void GC_delete_thread(DWORD thread_id) {
/* Must still be in_use, since nobody else can store our thread_id. */
i++) {}
if (i > my_max) {
- WARN("Removing nonexisiting thread %ld\n", (GC_word)thread_id);
+ WARN("Removing nonexistent thread %ld\n", (GC_word)thread_id);
} else {
GC_delete_gc_thread(thread_table+i);
}
@@ -232,6 +233,9 @@ void GC_push_thread_structures GC_PROTO((void))
# endif
}
+/* Defined in misc.c */
+extern CRITICAL_SECTION GC_write_cs;
+
void GC_stop_world()
{
DWORD thread_id = GetCurrentThreadId();
@@ -240,6 +244,9 @@ void GC_stop_world()
if (!GC_thr_initialized) ABORT("GC_stop_world() called before GC_thr_init()");
GC_please_stop = TRUE;
+# ifndef CYGWIN32
+ EnterCriticalSection(&GC_write_cs);
+# endif /* !CYGWIN32 */
for (i = 0; i <= GC_get_max_thread_index(); i++)
if (thread_table[i].stack_base != 0
&& thread_table[i].id != thread_id) {
@@ -270,6 +277,9 @@ void GC_stop_world()
# endif
thread_table[i].suspended = TRUE;
}
+# ifndef CYGWIN32
+ LeaveCriticalSection(&GC_write_cs);
+# endif /* !CYGWIN32 */
}
void GC_start_world()