RTS: Rename InCall.stat struct field to .rstat
authorHerbert Valerio Riedel <hvr@gnu.org>
Fri, 4 Dec 2015 09:10:55 +0000 (10:10 +0100)
committerHerbert Valerio Riedel <hvr@gnu.org>
Fri, 4 Dec 2015 09:11:30 +0000 (10:11 +0100)
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

rts/RtsAPI.c
rts/Schedule.c
rts/Task.c
rts/Task.h

index 2b3ad74..c64d8af 100644 (file)
@@ -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 *
index abbc363..e3dd881 100644 (file)
@@ -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);
index be72c1b..82f7780 100644 (file)
@@ -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;
index 58798bd..817a99a 100644 (file)
@@ -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;