Commit cd9f3bf9 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

RTS: Rename InCall.stat struct field to .rstat

On AIX, C system headers can redirect the token `stat` via

    #define stat stat64

to provide large-file support. Simply avoiding the use of `stat` as an
identifier eschews macro-replacement.

Differential Revision: https://phabricator.haskell.org/D1566
parent 7af29da0
......@@ -516,7 +516,7 @@ void rts_evalLazyIO_ (/* inout */ Capability **cap,
void
rts_checkSchedStatus (char* site, Capability *cap)
{
SchedulerStatus rc = cap->running_task->incall->stat;
SchedulerStatus rc = cap->running_task->incall->rstat;
switch (rc) {
case Success:
return;
......@@ -544,7 +544,7 @@ rts_checkSchedStatus (char* site, Capability *cap)
SchedulerStatus
rts_getSchedStatus (Capability *cap)
{
return cap->running_task->incall->stat;
return cap->running_task->incall->rstat;
}
Capability *
......
......@@ -1293,19 +1293,19 @@ scheduleHandleThreadFinished (Capability *cap STG_UNUSED, Task *task, StgTSO *t)
// NOTE: return val is stack->sp[1] (see StgStartup.hc)
*(task->incall->ret) = (StgClosure *)task->incall->tso->stackobj->sp[1];
}
task->incall->stat = Success;
task->incall->rstat = Success;
} else {
if (task->incall->ret) {
*(task->incall->ret) = NULL;
}
if (sched_state >= SCHED_INTERRUPTING) {
if (heap_overflow) {
task->incall->stat = HeapExhausted;
task->incall->rstat = HeapExhausted;
} else {
task->incall->stat = Interrupted;
task->incall->rstat = Interrupted;
}
} else {
task->incall->stat = Killed;
task->incall->rstat = Killed;
}
}
#ifdef DEBUG
......@@ -2351,7 +2351,7 @@ scheduleWaitThread (StgTSO* tso, /*[out]*/HaskellObj* ret, Capability **pcap)
task->incall->tso = tso;
task->incall->ret = ret;
task->incall->stat = NoStatus;
task->incall->rstat = NoStatus;
appendToRunQueue(cap,tso);
......@@ -2360,7 +2360,7 @@ scheduleWaitThread (StgTSO* tso, /*[out]*/HaskellObj* ret, Capability **pcap)
cap = schedule(cap,task);
ASSERT(task->incall->stat != NoStatus);
ASSERT(task->incall->rstat != NoStatus);
ASSERT_FULL_CAPABILITY_INVARIANTS(cap,task);
debugTrace(DEBUG_sched, "bound thread (%lu) finished", (unsigned long)id);
......
......@@ -264,7 +264,7 @@ newInCall (Task *task)
incall->task = task;
incall->suspended_tso = NULL;
incall->suspended_cap = NULL;
incall->stat = NoStatus;
incall->rstat = NoStatus;
incall->ret = NULL;
incall->next = NULL;
incall->prev = NULL;
......
......@@ -94,7 +94,7 @@ typedef struct InCall_ {
// without owning a Capability in the
// first place.
SchedulerStatus stat; // return status
SchedulerStatus rstat; // return status
StgClosure ** ret; // return value
struct Task_ *task;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment