summaryrefslogtreecommitdiff
path: root/rts/Messages.c
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-07-21 20:27:41 -0500
committerAustin Seipp <austin@well-typed.com>2014-07-28 09:29:15 -0500
commitf2a3f539a6fc1a92b4f1d7f01b51c8b69a63fb77 (patch)
treed926e53fe48f297cf5444f01b3715f7aefa5a82e /rts/Messages.c
parent7ee0b63a71994c5e1c55e7a0f52e6cb81c908571 (diff)
downloadhaskell-f2a3f539a6fc1a92b4f1d7f01b51c8b69a63fb77.tar.gz
rts: detab/dewhitespace Messages.c
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'rts/Messages.c')
-rw-r--r--rts/Messages.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/rts/Messages.c b/rts/Messages.c
index c5988f8b25..82d8699d60 100644
--- a/rts/Messages.c
+++ b/rts/Messages.c
@@ -25,7 +25,7 @@ void sendMessage(Capability *from_cap, Capability *to_cap, Message *msg)
{
ACQUIRE_LOCK(&to_cap->lock);
-#ifdef DEBUG
+#ifdef DEBUG
{
const StgInfoTable *i = msg->header.info;
if (i != &stg_MSG_THROWTO_info &&
@@ -44,7 +44,7 @@ void sendMessage(Capability *from_cap, Capability *to_cap, Message *msg)
recordClosureMutated(from_cap,(StgClosure*)msg);
if (to_cap->running_task == NULL) {
- to_cap->running_task = myTask();
+ to_cap->running_task = myTask();
// precond for releaseCapability_()
releaseCapability_(to_cap,rtsFalse);
} else {
@@ -73,7 +73,7 @@ loop:
if (i == &stg_MSG_TRY_WAKEUP_info)
{
StgTSO *tso = ((MessageWakeup *)m)->tso;
- debugTraceCap(DEBUG_sched, cap, "message: try wakeup thread %ld",
+ debugTraceCap(DEBUG_sched, cap, "message: try wakeup thread %ld",
(W_)tso->id);
tryWakeupThread(cap, tso);
}
@@ -89,7 +89,7 @@ loop:
goto loop;
}
- debugTraceCap(DEBUG_sched, cap, "message: throwTo %ld -> %ld",
+ debugTraceCap(DEBUG_sched, cap, "message: throwTo %ld -> %ld",
(W_)t->source->id, (W_)t->target->id);
ASSERT(t->source->why_blocked == BlockedOnMsgThrowTo);
@@ -144,10 +144,10 @@ loop:
This is called from two places: either we just entered a BLACKHOLE
(stg_BLACKHOLE_info), or we received a MSG_BLACKHOLE in our
- cap->inbox.
+ cap->inbox.
We need to establish whether the BLACKHOLE belongs to
- this Capability, and
+ this Capability, and
- if so, arrange to block the current thread on it
- otherwise, forward the message to the right place
@@ -166,7 +166,7 @@ nat messageBlackHole(Capability *cap, MessageBlackHole *msg)
StgClosure *bh = UNTAG_CLOSURE(msg->bh);
StgTSO *owner;
- debugTraceCap(DEBUG_sched, cap, "message: thread %d blocking on blackhole %p",
+ debugTraceCap(DEBUG_sched, cap, "message: thread %d blocking on blackhole %p",
(W_)msg->tso->id, msg->bh);
info = bh->header.info;
@@ -175,8 +175,8 @@ nat messageBlackHole(Capability *cap, MessageBlackHole *msg)
// BLACKHOLE has already been updated, and GC has shorted out the
// indirection, so the pointer no longer points to a BLACKHOLE at
// all.
- if (info != &stg_BLACKHOLE_info &&
- info != &stg_CAF_BLACKHOLE_info &&
+ if (info != &stg_BLACKHOLE_info &&
+ info != &stg_CAF_BLACKHOLE_info &&
info != &__stg_EAGER_BLACKHOLE_info &&
info != &stg_WHITEHOLE_info) {
// if it is a WHITEHOLE, then a thread is in the process of
@@ -219,15 +219,15 @@ loop:
// BLACKHOLE, so we first create a BLOCKING_QUEUE object.
bq = (StgBlockingQueue*)allocate(cap, sizeofW(StgBlockingQueue));
-
+
// initialise the BLOCKING_QUEUE object
SET_HDR(bq, &stg_BLOCKING_QUEUE_DIRTY_info, CCS_SYSTEM);
bq->bh = bh;
bq->queue = msg;
bq->owner = owner;
-
+
msg->link = (MessageBlackHole*)END_TSO_QUEUE;
-
+
// All BLOCKING_QUEUES are linked in a list on owner->bq, so
// that we can search through them in the event that there is
// a collision to update a BLACKHOLE and a BLOCKING_QUEUE
@@ -254,12 +254,12 @@ loop:
((StgInd*)bh)->indirectee = (StgClosure *)bq;
recordClosureMutated(cap,bh); // bh was mutated
- debugTraceCap(DEBUG_sched, cap, "thread %d blocked on thread %d",
+ debugTraceCap(DEBUG_sched, cap, "thread %d blocked on thread %d",
(W_)msg->tso->id, (W_)owner->id);
return 1; // blocked
}
- else if (info == &stg_BLOCKING_QUEUE_CLEAN_info ||
+ else if (info == &stg_BLOCKING_QUEUE_CLEAN_info ||
info == &stg_BLOCKING_QUEUE_DIRTY_info)
{
StgBlockingQueue *bq = (StgBlockingQueue *)p;
@@ -287,7 +287,7 @@ loop:
recordClosureMutated(cap,(StgClosure*)bq);
}
- debugTraceCap(DEBUG_sched, cap, "thread %d blocked on thread %d",
+ debugTraceCap(DEBUG_sched, cap, "thread %d blocked on thread %d",
(W_)msg->tso->id, (W_)owner->id);
// See above, #3838
@@ -297,7 +297,7 @@ loop:
return 1; // blocked
}
-
+
return 0; // not blocked
}
@@ -313,7 +313,7 @@ StgTSO * blackHoleOwner (StgClosure *bh)
info = bh->header.info;
if (info != &stg_BLACKHOLE_info &&
- info != &stg_CAF_BLACKHOLE_info &&
+ info != &stg_CAF_BLACKHOLE_info &&
info != &__stg_EAGER_BLACKHOLE_info &&
info != &stg_WHITEHOLE_info) {
return NULL;
@@ -333,14 +333,12 @@ loop:
{
return (StgTSO*)p;
}
- else if (info == &stg_BLOCKING_QUEUE_CLEAN_info ||
+ else if (info == &stg_BLOCKING_QUEUE_CLEAN_info ||
info == &stg_BLOCKING_QUEUE_DIRTY_info)
{
StgBlockingQueue *bq = (StgBlockingQueue *)p;
return bq->owner;
}
-
+
return NULL; // not blocked
}
-
-