]> granicus.if.org Git - gc/commitdiff
Do not define GC_write_cs for Xbox One target
authorIvan Maidanski <ivmai@mail.ru>
Wed, 11 Sep 2019 20:03:49 +0000 (23:03 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 11 Sep 2019 20:44:05 +0000 (23:44 +0300)
(fix of commit d16debf3e)

Issue #173 (bdwgc).

GC_write_cs is not used in GC_write thus there is no need to define
and use it in GC_stop_world.

* include/private/gc_priv.h [THREADS && MSWIN_XBOX1] (GC_write_cs):
Do not declare.
* misc.c [THREADS && MSWIN_XBOX1] (GC_write_cs): Do not define.
* win32_threads.c (GC_stop_world): Call EnterCriticalSection() and
LeaveCriticalSection() only if MSWIN32 or MSWINCE.

include/private/gc_priv.h
misc.c
win32_threads.c

index ef81ae63e2bfeae341e0027dca7142b8fd72276f..03fc1d2a1da7b314574b6867f7955ad947d03d9f 100644 (file)
@@ -2348,15 +2348,15 @@ GC_EXTERN signed_word GC_bytes_found;
 #endif
 
 #ifdef THREADS
-# if defined(MSWIN32) || defined(MSWINCE) || defined(MSWIN_XBOX1)
+# if defined(MSWIN32) || defined(MSWINCE)
     GC_EXTERN CRITICAL_SECTION GC_write_cs; /* defined in misc.c */
-# endif
-# if defined(GC_ASSERTIONS) && (defined(MSWIN32) || defined(MSWINCE))
-    GC_EXTERN GC_bool GC_write_disabled;
+#   ifdef GC_ASSERTIONS
+      GC_EXTERN GC_bool GC_write_disabled;
                                 /* defined in win32_threads.c;  */
                                 /* protected by GC_write_cs.    */
 
-# endif
+#   endif
+# endif /* MSWIN32 || MSWINCE */
 # if defined(GC_DISABLE_INCREMENTAL) || defined(HAVE_LOCKFREE_AO_OR)
 #   define GC_acquire_dirty_lock() (void)0
 #   define GC_release_dirty_lock() (void)0
diff --git a/misc.c b/misc.c
index c063b26c5748933d36c1701656a70c7327254735..9d02f65e239482fbbf94ec09cc8b2e0427e4e4ed 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -749,8 +749,7 @@ GC_API int GC_CALL GC_is_init_called(void)
   return GC_is_initialized;
 }
 
-#if (defined(MSWIN32) || defined(MSWINCE) || defined(MSWIN_XBOX1)) \
-    && defined(THREADS)
+#if (defined(MSWIN32) || defined(MSWINCE)) && defined(THREADS)
   GC_INNER CRITICAL_SECTION GC_write_cs;
 #endif
 
index f6049b39934b4afbf1601b4fe4d61e3a38c127f0..dac29e105b18a1855ffe29b225e1ceba80591e70 100644 (file)
@@ -1357,18 +1357,16 @@ GC_INNER void GC_stop_world(void)
 # if !defined(GC_NO_THREADS_DISCOVERY) || defined(GC_ASSERTIONS)
     GC_please_stop = TRUE;
 # endif
-# ifndef CYGWIN32
-#   ifndef MSWIN_XBOX1
-      GC_ASSERT(!GC_write_disabled);
-#   endif
+# if defined(MSWIN32) || defined(MSWINCE)
+    GC_ASSERT(!GC_write_disabled);
     EnterCriticalSection(&GC_write_cs);
-# endif
-# if defined(GC_ASSERTIONS) && (defined(MSWIN32) || defined(MSWINCE))
     /* It's not allowed to call GC_printf() (and friends) here down to  */
     /* LeaveCriticalSection (same applies recursively to GC_suspend,    */
     /* GC_delete_gc_thread_no_free, GC_get_max_thread_index, GC_size    */
     /* and GC_remove_protection).                                       */
-    GC_write_disabled = TRUE;
+#   ifdef GC_ASSERTIONS
+      GC_write_disabled = TRUE;
+#   endif
 # endif
 # ifndef GC_NO_THREADS_DISCOVERY
     if (GC_win32_dll_threads) {
@@ -1401,10 +1399,10 @@ GC_INNER void GC_stop_world(void)
       }
     }
   }
-# if defined(GC_ASSERTIONS) && (defined(MSWIN32) || defined(MSWINCE))
-    GC_write_disabled = FALSE;
-# endif
-# ifndef CYGWIN32
+# if defined(MSWIN32) || defined(MSWINCE)
+#   ifdef GC_ASSERTIONS
+      GC_write_disabled = FALSE;
+#   endif
     LeaveCriticalSection(&GC_write_cs);
 # endif
 # ifdef PARALLEL_MARK