diff options
| author | Simon Marlow <simonmar@microsoft.com> | 2006-03-13 15:53:47 +0000 |
|---|---|---|
| committer | Simon Marlow <simonmar@microsoft.com> | 2006-03-13 15:53:47 +0000 |
| commit | 2f861d149686a96d7783ce984afa7c263a39c355 (patch) | |
| tree | 4daccb6d2330a81a784a691650ed98fd3b1f08b8 | |
| parent | 0dbbf1932d550293986af6244202cb735b2cd966 (diff) | |
| download | haskell-2f861d149686a96d7783ce984afa7c263a39c355.tar.gz | |
fix bug in previous patch to this file
| -rw-r--r-- | ghc/rts/Capability.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ghc/rts/Capability.c b/ghc/rts/Capability.c index 203ca9f301..8c40b63992 100644 --- a/ghc/rts/Capability.c +++ b/ghc/rts/Capability.c @@ -59,16 +59,17 @@ anyWorkForMe( Capability *cap, Task *task ) // can't be sure that we have the right capability: the thread // might be woken up on some other capability, and task->cap // could change under our feet. - return (!emptyRunQueue(cap) && cap->run_queue_hd->bound == task); + return !emptyRunQueue(cap) && cap->run_queue_hd->bound == task; } else { - // A vanilla worker task runs if either (a) there is a - // lightweight thread at the head of the run queue, or (b) - // there are sparks to execute, or (c) there is some other - // global condition to check, such as threads blocked on - // blackholes. - return ((!emptyRunQueue(cap) && cap->run_queue_hd->bound == NULL) - || !emptySparkPoolCap(cap) - || globalWorkToDo()); + // A vanilla worker task runs if either there is a lightweight + // thread at the head of the run queue, or the run queue is + // empty and (there are sparks to execute, or there is some + // other global condition to check, such as threads blocked on + // blackholes). + if (emptyRunQueue(cap)) { + return !emptySparkPoolCap(cap) || globalWorkToDo(); + } else + return cap->run_queue_hd->bound == NULL; } } #endif |
