summaryrefslogtreecommitdiff
path: root/rts/Sparks.c
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2011-06-01 18:17:27 +0100
committerDuncan Coutts <duncan@well-typed.com>2011-07-18 16:31:13 +0100
commitededf355981fd08f52b4fab256f231179848073f (patch)
tree8e58b1f32cbee934de31f6012b19d5d55c6f08a1 /rts/Sparks.c
parente0b98b42847dea19aff24df2faa354c9d414fc87 (diff)
downloadhaskell-ededf355981fd08f52b4fab256f231179848073f.tar.gz
Change tryStealSpark so it does not consume fizzled sparks
We want to count fizzled sparks accurately. Now tryStealSpark returns fizzled sparks, and the callers now update the fizzled spark count.
Diffstat (limited to 'rts/Sparks.c')
-rw-r--r--rts/Sparks.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/rts/Sparks.c b/rts/Sparks.c
index 18d9597ec2..5c78055e8c 100644
--- a/rts/Sparks.c
+++ b/rts/Sparks.c
@@ -73,32 +73,6 @@ newSpark (StgRegTable *reg, StgClosure *p)
return 1;
}
-/* -----------------------------------------------------------------------------
- *
- * tryStealSpark: try to steal a spark from a Capability.
- *
- * Returns a valid spark, or NULL if the pool was empty, and can
- * occasionally return NULL if there was a race with another thread
- * stealing from the same pool. In this case, try again later.
- *
- -------------------------------------------------------------------------- */
-
-StgClosure *
-tryStealSpark (Capability *cap)
-{
- SparkPool *pool = cap->sparks;
- StgClosure *stolen;
-
- do {
- stolen = stealWSDeque_(pool);
- // use the no-loopy version, stealWSDeque_(), since if we get a
- // spurious NULL here the caller may want to try stealing from
- // other pools before trying again.
- } while (stolen != NULL && !closure_SHOULD_SPARK(stolen));
-
- return stolen;
-}
-
/* --------------------------------------------------------------------------
* Remove all sparks from the spark queues which should not spark any
* more. Called after GC. We assume exclusive access to the structure