Commit 65914a2c authored by Simon Marlow's avatar Simon Marlow

Remove incorrect assertions in steal()

parent 58852522
......@@ -202,10 +202,12 @@ steal(SparkPool *deque)
StgClosurePtr stolen;
StgWord b,t;
ASSERT_SPARK_POOL_INVARIANTS(deque);
// Can't do this on someone else's spark pool:
// ASSERT_SPARK_POOL_INVARIANTS(deque);
b = deque->bottom;
t = deque->top;
if (b - t <= 0 ) {
return NULL; /* already looks empty, abort */
}
......@@ -222,7 +224,9 @@ steal(SparkPool *deque)
return NULL;
} /* else: OK, top has been incremented by the cas call */
ASSERT_SPARK_POOL_INVARIANTS(deque);
// Can't do this on someone else's spark pool:
// ASSERT_SPARK_POOL_INVARIANTS(deque);
/* return stolen element */
return stolen;
}
......
......@@ -52,7 +52,12 @@ typedef struct SparkPool_ {
/* INVARIANTS, in this order: reasonable size,
topBound consistent, space pointer, space accessible to us */
topBound consistent, space pointer, space accessible to us.
NB. This is safe to use only (a) on a spark pool owned by the
current thread, or (b) when there's only one thread running, or no
stealing going on (e.g. during GC).
*/
#define ASSERT_SPARK_POOL_INVARIANTS(p) \
ASSERT((p)->size > 0); \
ASSERT((p)->topBound <= (p)->top); \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment