]> granicus.if.org Git - gc/commitdiff
Fix assertion on mark_lock_holder for non-unique NUMERIC_THREAD_ID
authorIvan Maidanski <ivmai@mail.ru>
Fri, 22 Aug 2014 10:54:53 +0000 (14:54 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 11 Mar 2016 21:09:06 +0000 (00:09 +0300)
(Apply commit 8cdc862 from 'master' branch.)

* pthread_support.c (GC_acquire_mark_lock): Avoid assertion that
GC_mark_lock_holder != NUMERIC_THREAD_ID(pthread_self()) unless
NUMERIC_THREAD_ID_UNIQUE.
* win32_threads.c (GC_acquire_mark_lock): Likewise.
* win32_threads.c (NUMERIC_THREAD_ID): Add comment.

pthread_support.c
win32_threads.c

index b7f0ad52fb73b13a9dce269d94986ce640c3b108..c66b08f8fd8d53d5c2925b9118e767764e591209 100644 (file)
@@ -2030,7 +2030,9 @@ static void setup_mark_lock(void)
 
 GC_INNER void GC_acquire_mark_lock(void)
 {
-    GC_ASSERT(GC_mark_lock_holder != NUMERIC_THREAD_ID(pthread_self()));
+#   ifdef NUMERIC_THREAD_ID_UNIQUE
+      GC_ASSERT(GC_mark_lock_holder != NUMERIC_THREAD_ID(pthread_self()));
+#   endif
     GC_generic_lock(&mark_mutex);
     SET_MARK_LOCK_HOLDER;
 }
index ff97f2925b363d67e189a1ce0c3604a1fb8740ba..74e47d9e183252bc3f7db226e7eae8d7d0e0130d 100644 (file)
@@ -1804,7 +1804,9 @@ GC_INNER void GC_get_next_stack(char *start, char *limit,
 
     GC_INNER void GC_acquire_mark_lock(void)
     {
-      GC_ASSERT(GC_mark_lock_holder != NUMERIC_THREAD_ID(pthread_self()));
+#     ifdef NUMERIC_THREAD_ID_UNIQUE
+        GC_ASSERT(GC_mark_lock_holder != NUMERIC_THREAD_ID(pthread_self()));
+#     endif
       if (pthread_mutex_lock(&mark_mutex) != 0) {
         ABORT("pthread_mutex_lock failed");
       }