summaryrefslogtreecommitdiff
path: root/rts/Capability.c
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@mit.edu>2013-01-15 15:04:08 -0800
committerEdward Z. Yang <ezyang@mit.edu>2013-01-16 13:49:01 -0800
commit0aae1e173b4731a60648960aa03910ccb16fe0e0 (patch)
tree4d9e2e7d57f86dd5e4fafc2879fd060388aa50ef /rts/Capability.c
parent8f731f2ba83cd62da78a3ef8f1560902948f97a4 (diff)
downloadhaskell-0aae1e173b4731a60648960aa03910ccb16fe0e0.tar.gz
Better abstraction over run queues.
This adds some new functions: peekRunQueue, promoteInRunQueue, singletonRunQueue and truncateRunQueue which help abstract away manual linked list manipulation, making it easier to swap in a new queue implementation. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Diffstat (limited to 'rts/Capability.c')
-rw-r--r--rts/Capability.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/Capability.c b/rts/Capability.c
index d02c34d311..811df582a8 100644
--- a/rts/Capability.c
+++ b/rts/Capability.c
@@ -472,13 +472,13 @@ releaseCapability_ (Capability* cap,
// If the next thread on the run queue is a bound thread,
// give this Capability to the appropriate Task.
- if (!emptyRunQueue(cap) && cap->run_queue_hd->bound) {
+ if (!emptyRunQueue(cap) && peekRunQueue(cap)->bound) {
// Make sure we're not about to try to wake ourselves up
// ASSERT(task != cap->run_queue_hd->bound);
// assertion is false: in schedule() we force a yield after
// ThreadBlocked, but the thread may be back on the run queue
// by now.
- task = cap->run_queue_hd->bound->task;
+ task = peekRunQueue(cap)->bound->task;
giveCapabilityToTask(cap, task);
return;
}