summaryrefslogtreecommitdiff
path: root/rts/Messages.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/Messages.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/Messages.c')
-rw-r--r--rts/Messages.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/rts/Messages.c b/rts/Messages.c
index 34dcbdf56d..c5988f8b25 100644
--- a/rts/Messages.c
+++ b/rts/Messages.c
@@ -246,8 +246,7 @@ loop:
// the current thread, since in that case it will not be on
// the run queue.
if (owner->why_blocked == NotBlocked && owner->id != msg->tso->id) {
- removeFromRunQueue(cap, owner);
- pushOnRunQueue(cap,owner);
+ promoteInRunQueue(cap, owner);
}
// point to the BLOCKING_QUEUE from the BLACKHOLE
@@ -293,8 +292,7 @@ loop:
// See above, #3838
if (owner->why_blocked == NotBlocked && owner->id != msg->tso->id) {
- removeFromRunQueue(cap, owner);
- pushOnRunQueue(cap,owner);
+ promoteInRunQueue(cap, owner);
}
return 1; // blocked