[project @ 2005-10-21 14:02:17 by simonmar]
[ghc-hetmet.git] / ghc / includes / Updates.h
index 0d0bf2f..4bc6199 100644 (file)
@@ -185,8 +185,13 @@ extern void awakenBlockedQueue(StgBlockingQueueElement *q, StgClosure *node);
  * to point to itself, and the closure being updated should not
  * already have been updated (the mutable list will get messed up
  * otherwise).
+ *
+ * NB. We do *not* do this in SMP mode, because when we have the
+ * possibility of multiple threads entering the same closure, zeroing
+ * the slop in one of the threads would have a disastrous effect on
+ * the other (seen in the wild!).
  */
-#if !defined(DEBUG)
+#if !defined(DEBUG) || defined(SMP)
 
 #define DEBUG_FILL_SLOP(p) /* nothing */
 
@@ -265,7 +270,8 @@ DEBUG_FILL_SLOP(StgClosure *p)
                                                                \
 /*    ASSERT( p1 != p2 && !closure_IND(p1) );                  \
  */ LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(p1);                     \
-    bd = Bdescr(p1);                                           \
+/*  foreign "C" cas(p1 "ptr", 0, stg_WHITEHOLE_info);          \
+ */ bd = Bdescr(p1);                                           \
     if (bdescr_gen_no(bd) == 0 :: CInt) {                      \
       StgInd_indirectee(p1) = p2;                              \
       SET_INFO(p1, ind_info);                                  \
@@ -287,6 +293,7 @@ DEBUG_FILL_SLOP(StgClosure *p)
   {                                                                    \
     bdescr *bd;                                                                \
                                                                        \
+    /* cas(p1, 0, &stg_WHITEHOLE_info); */                             \
     ASSERT( (P_)p1 != (P_)p2 && !closure_IND(p1) );                    \
     LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(p1);                             \
     bd = Bdescr((P_)p1);                                               \