Commit d37986fe authored by simonmar's avatar simonmar

[project @ 2000-03-17 13:30:23 by simonmar]

Random cleanup: rename the TSO->whatNext field to what_next, to be a
bit more consistent.
parent 8ae10d70
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: StgMacros.h,v 1.23 2000/03/16 12:40:40 simonmar Exp $ * $Id: StgMacros.h,v 1.24 2000/03/17 13:30:23 simonmar Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -365,7 +365,7 @@ EF_(stg_gen_block); ...@@ -365,7 +365,7 @@ EF_(stg_gen_block);
#define THREAD_RETURN(ptrs) \ #define THREAD_RETURN(ptrs) \
ASSERT(ptrs==1); \ ASSERT(ptrs==1); \
CurrentTSO->whatNext = ThreadEnterGHC; \ CurrentTSO->what_next = ThreadEnterGHC; \
R1.i = ThreadBlocked; \ R1.i = ThreadBlocked; \
JMP_(StgReturn); JMP_(StgReturn);
#endif #endif
......
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: TSO.h,v 1.12 2000/03/17 09:53:19 simonmar Exp $ * $Id: TSO.h,v 1.13 2000/03/17 13:30:23 simonmar Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -72,7 +72,7 @@ typedef enum { ...@@ -72,7 +72,7 @@ typedef enum {
} StgTSOState; } StgTSOState;
/* /*
* The whatNext field of a TSO indicates how the thread is to be run. * The what_next field of a TSO indicates how the thread is to be run.
*/ */
typedef enum { typedef enum {
ThreadEnterGHC, /* enter top thunk on stack */ ThreadEnterGHC, /* enter top thunk on stack */
...@@ -149,7 +149,7 @@ typedef struct StgTSO_ { ...@@ -149,7 +149,7 @@ typedef struct StgTSO_ {
StgMutClosure * mut_link; /* TSO's are mutable of course! */ StgMutClosure * mut_link; /* TSO's are mutable of course! */
struct StgTSO_* global_link; /* Links all threads together */ struct StgTSO_* global_link; /* Links all threads together */
StgTSOWhatNext whatNext; StgTSOWhatNext what_next;
StgTSOBlockReason why_blocked; StgTSOBlockReason why_blocked;
StgTSOBlockInfo block_info; StgTSOBlockInfo block_info;
struct StgTSO_* blocked_exceptions; struct StgTSO_* blocked_exceptions;
...@@ -203,12 +203,12 @@ typedef struct StgTSO_ { ...@@ -203,12 +203,12 @@ typedef struct StgTSO_ {
A zombie thread has the following properties: A zombie thread has the following properties:
tso->whatNext == ThreadComplete or ThreadKilled tso->what_next == ThreadComplete or ThreadKilled
tso->link == (could be on some queue somewhere) tso->link == (could be on some queue somewhere)
tso->su == tso->stack + tso->stack_size tso->su == tso->stack + tso->stack_size
tso->sp == tso->stack + tso->stack_size - 1 (i.e. top stack word) tso->sp == tso->stack + tso->stack_size - 1 (i.e. top stack word)
tso->sp[0] == return value of thread, if whatNext == ThreadComplete, tso->sp[0] == return value of thread, if what_next == ThreadComplete,
exception , if whatNext == ThreadKilled exception , if what_next == ThreadKilled
(tso->sp is left pointing at the top word on the stack so that (tso->sp is left pointing at the top word on the stack so that
the return value or exception will be retained by a GC). the return value or exception will be retained by a GC).
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* Copyright (c) 1994-1998. * Copyright (c) 1994-1998.
* *
* $RCSfile: Evaluator.c,v $ * $RCSfile: Evaluator.c,v $
* $Revision: 1.40 $ * $Revision: 1.41 $
* $Date: 2000/03/14 14:34:47 $ * $Date: 2000/03/17 13:30:23 $
* ---------------------------------------------------------------------------*/ * ---------------------------------------------------------------------------*/
#include "Rts.h" #include "Rts.h"
...@@ -1343,7 +1343,7 @@ StgThreadReturnCode enter( Capability* cap, StgClosure* obj0 ) ...@@ -1343,7 +1343,7 @@ StgThreadReturnCode enter( Capability* cap, StgClosure* obj0 )
case SE_CAF_BLACKHOLE: case SE_CAF_BLACKHOLE:
{ {
/* Let the scheduler figure out what to do :-) */ /* Let the scheduler figure out what to do :-) */
cap->rCurrentTSO->whatNext = ThreadEnterGHC; cap->rCurrentTSO->what_next = ThreadEnterGHC;
xPushCPtr(obj); xPushCPtr(obj);
RETURN(ThreadYielding); RETURN(ThreadYielding);
} }
...@@ -1454,7 +1454,7 @@ StgThreadReturnCode enter( Capability* cap, StgClosure* obj0 ) ...@@ -1454,7 +1454,7 @@ StgThreadReturnCode enter( Capability* cap, StgClosure* obj0 )
case RET_VEC_SMALL: case RET_VEC_SMALL:
case RET_BIG: case RET_BIG:
case RET_VEC_BIG: case RET_VEC_BIG:
cap->rCurrentTSO->whatNext = ThreadEnterGHC; cap->rCurrentTSO->what_next = ThreadEnterGHC;
xPushCPtr(obj); xPushCPtr(obj);
RETURN(ThreadYielding); RETURN(ThreadYielding);
default: default:
...@@ -1475,7 +1475,7 @@ StgThreadReturnCode enter( Capability* cap, StgClosure* obj0 ) ...@@ -1475,7 +1475,7 @@ StgThreadReturnCode enter( Capability* cap, StgClosure* obj0 )
//fprintf(stderr, "entering unknown closure -- yielding to sched\n"); //fprintf(stderr, "entering unknown closure -- yielding to sched\n");
//printObj(obj); //printObj(obj);
//LLL; //LLL;
cap->rCurrentTSO->whatNext = ThreadEnterGHC; cap->rCurrentTSO->what_next = ThreadEnterGHC;
xPushCPtr(obj); /* code to restart with */ xPushCPtr(obj); /* code to restart with */
RETURN(ThreadYielding); RETURN(ThreadYielding);
} }
......
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: Exception.hc,v 1.9 2000/03/17 10:24:44 simonmar Exp $ * $Id: Exception.hc,v 1.10 2000/03/17 13:30:23 simonmar Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -152,7 +152,7 @@ FN_(killThreadzh_fast) ...@@ -152,7 +152,7 @@ FN_(killThreadzh_fast)
/* This thread may have been relocated. /* This thread may have been relocated.
* (see Schedule.c:threadStackOverflow) * (see Schedule.c:threadStackOverflow)
*/ */
while (R1.t->whatNext == ThreadRelocated) { while (R1.t->what_next == ThreadRelocated) {
R1.t = R1.t->link; R1.t = R1.t->link;
} }
...@@ -188,12 +188,12 @@ FN_(killThreadzh_fast) ...@@ -188,12 +188,12 @@ FN_(killThreadzh_fast)
if (R1.t == CurrentTSO) { if (R1.t == CurrentTSO) {
SaveThreadState(); /* inline! */ SaveThreadState(); /* inline! */
STGCALL2(raiseAsync, R1.t, R2.cl); STGCALL2(raiseAsync, R1.t, R2.cl);
if (CurrentTSO->whatNext == ThreadKilled) { if (CurrentTSO->what_next == ThreadKilled) {
R1.w = ThreadYielding; R1.w = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
} }
LoadThreadState(); LoadThreadState();
if (CurrentTSO->whatNext == ThreadEnterGHC) { if (CurrentTSO->what_next == ThreadEnterGHC) {
R1.w = Sp[0]; R1.w = Sp[0];
Sp++; Sp++;
JMP_(GET_ENTRY(R1.cl)); JMP_(GET_ENTRY(R1.cl));
......
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: GC.c,v 1.73 2000/03/16 17:27:12 simonmar Exp $ * $Id: GC.c,v 1.74 2000/03/17 13:30:24 simonmar Exp $
* *
* (c) The GHC Team 1998-1999 * (c) The GHC Team 1998-1999
* *
...@@ -856,7 +856,7 @@ traverse_weak_ptr_list(void) ...@@ -856,7 +856,7 @@ traverse_weak_ptr_list(void)
/* Threads which have finished or died get dropped from /* Threads which have finished or died get dropped from
* the list. * the list.
*/ */
switch (t->whatNext) { switch (t->what_next) {
case ThreadKilled: case ThreadKilled:
case ThreadComplete: case ThreadComplete:
next = t->global_link; next = t->global_link;
...@@ -1005,7 +1005,7 @@ isAlive(StgClosure *p) ...@@ -1005,7 +1005,7 @@ isAlive(StgClosure *p)
goto large; goto large;
case TSO: case TSO:
if (((StgTSO *)p)->whatNext == ThreadRelocated) { if (((StgTSO *)p)->what_next == ThreadRelocated) {
p = (StgClosure *)((StgTSO *)p)->link; p = (StgClosure *)((StgTSO *)p)->link;
continue; continue;
} }
...@@ -1591,7 +1591,7 @@ loop: ...@@ -1591,7 +1591,7 @@ loop:
/* Deal with redirected TSOs (a TSO that's had its stack enlarged). /* Deal with redirected TSOs (a TSO that's had its stack enlarged).
*/ */
if (tso->whatNext == ThreadRelocated) { if (tso->what_next == ThreadRelocated) {
q = (StgClosure *)tso->link; q = (StgClosure *)tso->link;
goto loop; goto loop;
} }
......
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: HeapStackCheck.hc,v 1.12 2000/03/02 10:11:50 sewardj Exp $ * $Id: HeapStackCheck.hc,v 1.13 2000/03/17 13:30:24 simonmar Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
R1.i = StackOverflow; \ R1.i = StackOverflow; \
} \ } \
SaveThreadState(); \ SaveThreadState(); \
CurrentTSO->whatNext = ThreadRunGHC; \ CurrentTSO->what_next = ThreadRunGHC; \
JMP_(StgReturn); JMP_(StgReturn);
#define GC_ENTER \ #define GC_ENTER \
...@@ -84,42 +84,42 @@ ...@@ -84,42 +84,42 @@
R1.i = StackOverflow; \ R1.i = StackOverflow; \
} \ } \
SaveThreadState(); \ SaveThreadState(); \
CurrentTSO->whatNext = ThreadEnterGHC; \ CurrentTSO->what_next = ThreadEnterGHC; \
JMP_(StgReturn); JMP_(StgReturn);
#define HP_GENERIC \ #define HP_GENERIC \
SaveThreadState(); \ SaveThreadState(); \
CurrentTSO->whatNext = ThreadRunGHC; \ CurrentTSO->what_next = ThreadRunGHC; \
R1.i = HeapOverflow; \ R1.i = HeapOverflow; \
JMP_(StgReturn); JMP_(StgReturn);
#define STK_GENERIC \ #define STK_GENERIC \
SaveThreadState(); \ SaveThreadState(); \
CurrentTSO->whatNext = ThreadRunGHC; \ CurrentTSO->what_next = ThreadRunGHC; \
R1.i = StackOverflow; \ R1.i = StackOverflow; \
JMP_(StgReturn); JMP_(StgReturn);
#define YIELD_GENERIC \ #define YIELD_GENERIC \
SaveThreadState(); \ SaveThreadState(); \
CurrentTSO->whatNext = ThreadRunGHC; \ CurrentTSO->what_next = ThreadRunGHC; \
R1.i = ThreadYielding; \ R1.i = ThreadYielding; \
JMP_(StgReturn); JMP_(StgReturn);
#define YIELD_TO_HUGS \ #define YIELD_TO_HUGS \
SaveThreadState(); \ SaveThreadState(); \
CurrentTSO->whatNext = ThreadEnterHugs; \ CurrentTSO->what_next = ThreadEnterHugs; \
R1.i = ThreadYielding; \ R1.i = ThreadYielding; \
JMP_(StgReturn); JMP_(StgReturn);
#define BLOCK_GENERIC \ #define BLOCK_GENERIC \
SaveThreadState(); \ SaveThreadState(); \
CurrentTSO->whatNext = ThreadRunGHC; \ CurrentTSO->what_next = ThreadRunGHC; \
R1.i = ThreadBlocked; \ R1.i = ThreadBlocked; \
JMP_(StgReturn); JMP_(StgReturn);
#define BLOCK_ENTER \ #define BLOCK_ENTER \
SaveThreadState(); \ SaveThreadState(); \
CurrentTSO->whatNext = ThreadEnterGHC;\ CurrentTSO->what_next = ThreadEnterGHC;\
R1.i = ThreadBlocked; \ R1.i = ThreadBlocked; \
JMP_(StgReturn); JMP_(StgReturn);
...@@ -166,7 +166,7 @@ EXTFUN(stg_gc_enter_1_hponly) ...@@ -166,7 +166,7 @@ EXTFUN(stg_gc_enter_1_hponly)
Sp[0] = R1.w; Sp[0] = R1.w;
R1.i = HeapOverflow; R1.i = HeapOverflow;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
} }
...@@ -289,7 +289,7 @@ EXTFUN(gran_yield_0) ...@@ -289,7 +289,7 @@ EXTFUN(gran_yield_0)
{ {
FB_ FB_
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadYielding; R1.i = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -301,7 +301,7 @@ EXTFUN(gran_yield_1) ...@@ -301,7 +301,7 @@ EXTFUN(gran_yield_1)
Sp -= 1; Sp -= 1;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadYielding; R1.i = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -316,7 +316,7 @@ EXTFUN(gran_yield_2) ...@@ -316,7 +316,7 @@ EXTFUN(gran_yield_2)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadYielding; R1.i = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -332,7 +332,7 @@ EXTFUN(gran_yield_3) ...@@ -332,7 +332,7 @@ EXTFUN(gran_yield_3)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadYielding; R1.i = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -349,7 +349,7 @@ EXTFUN(gran_yield_4) ...@@ -349,7 +349,7 @@ EXTFUN(gran_yield_4)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadYielding; R1.i = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -367,7 +367,7 @@ EXTFUN(gran_yield_5) ...@@ -367,7 +367,7 @@ EXTFUN(gran_yield_5)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadYielding; R1.i = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -386,7 +386,7 @@ EXTFUN(gran_yield_6) ...@@ -386,7 +386,7 @@ EXTFUN(gran_yield_6)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadYielding; R1.i = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -406,7 +406,7 @@ EXTFUN(gran_yield_7) ...@@ -406,7 +406,7 @@ EXTFUN(gran_yield_7)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadYielding; R1.i = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -427,7 +427,7 @@ EXTFUN(gran_yield_8) ...@@ -427,7 +427,7 @@ EXTFUN(gran_yield_8)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadYielding; R1.i = ThreadYielding;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -441,7 +441,7 @@ EXTFUN(gran_block_1) ...@@ -441,7 +441,7 @@ EXTFUN(gran_block_1)
Sp -= 1; Sp -= 1;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadBlocked; R1.i = ThreadBlocked;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -456,7 +456,7 @@ EXTFUN(gran_block_2) ...@@ -456,7 +456,7 @@ EXTFUN(gran_block_2)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadBlocked; R1.i = ThreadBlocked;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -472,7 +472,7 @@ EXTFUN(gran_block_3) ...@@ -472,7 +472,7 @@ EXTFUN(gran_block_3)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadBlocked; R1.i = ThreadBlocked;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -489,7 +489,7 @@ EXTFUN(gran_block_4) ...@@ -489,7 +489,7 @@ EXTFUN(gran_block_4)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadBlocked; R1.i = ThreadBlocked;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -507,7 +507,7 @@ EXTFUN(gran_block_5) ...@@ -507,7 +507,7 @@ EXTFUN(gran_block_5)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadBlocked; R1.i = ThreadBlocked;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -526,7 +526,7 @@ EXTFUN(gran_block_6) ...@@ -526,7 +526,7 @@ EXTFUN(gran_block_6)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadBlocked; R1.i = ThreadBlocked;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -546,7 +546,7 @@ EXTFUN(gran_block_7) ...@@ -546,7 +546,7 @@ EXTFUN(gran_block_7)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadBlocked; R1.i = ThreadBlocked;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -567,7 +567,7 @@ EXTFUN(gran_block_8) ...@@ -567,7 +567,7 @@ EXTFUN(gran_block_8)
Sp[1] = R2.w; Sp[1] = R2.w;
Sp[0] = R1.w; Sp[0] = R1.w;
SaveThreadState(); SaveThreadState();
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadBlocked; R1.i = ThreadBlocked;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
...@@ -596,7 +596,7 @@ EXTFUN(par_block_1_no_jump) ...@@ -596,7 +596,7 @@ EXTFUN(par_block_1_no_jump)
EXTFUN(par_jump) EXTFUN(par_jump)
{ {
FB_ FB_
CurrentTSO->whatNext = ThreadEnterGHC; CurrentTSO->what_next = ThreadEnterGHC;
R1.i = ThreadBlocked; R1.i = ThreadBlocked;
JMP_(StgReturn); JMP_(StgReturn);
FE_ FE_
......
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: Sanity.c,v 1.16 2000/01/30 10:16:09 simonmar Exp $ * $Id: Sanity.c,v 1.17 2000/03/17 13:30:24 simonmar Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -471,12 +471,12 @@ checkTSO(StgTSO *tso) ...@@ -471,12 +471,12 @@ checkTSO(StgTSO *tso)
StgOffset stack_size = tso->stack_size; StgOffset stack_size = tso->stack_size;
StgPtr stack_end = stack + stack_size; StgPtr stack_end = stack + stack_size;
if (tso->whatNext == ThreadRelocated) { if (tso->what_next == ThreadRelocated) {
checkTSO(tso->link); checkTSO(tso->link);
return; return;
} }
if (tso->whatNext == ThreadComplete || tso->whatNext == ThreadKilled) { if (tso->what_next == ThreadComplete || tso->what_next == ThreadKilled) {
/* The garbage collector doesn't bother following any pointers /* The garbage collector doesn't bother following any pointers
* from dead threads, so don't check sanity here. * from dead threads, so don't check sanity here.
*/ */
......
/* --------------------------------------------------------------------------- /* ---------------------------------------------------------------------------
* $Id: Schedule.c,v 1.54 2000/03/16 17:33:04 simonmar Exp $ * $Id: Schedule.c,v 1.55 2000/03/17 13:30:24 simonmar Exp $
* *
* (c) The GHC Team, 1998-2000 * (c) The GHC Team, 1998-2000
* *
...@@ -342,7 +342,7 @@ schedule( void ) ...@@ -342,7 +342,7 @@ schedule( void )
StgMainThread *m, **prev; StgMainThread *m, **prev;
prev = &main_threads; prev = &main_threads;
for (m = main_threads; m != NULL; m = m->link) { for (m = main_threads; m != NULL; m = m->link) {
switch (m->tso->whatNext) { switch (m->tso->what_next) {
case ThreadComplete: case ThreadComplete:
if (m->ret) { if (m->ret) {
*(m->ret) = (StgClosure *)m->tso->sp[0]; *(m->ret) = (StgClosure *)m->tso->sp[0];
...@@ -370,10 +370,10 @@ schedule( void ) ...@@ -370,10 +370,10 @@ schedule( void )
*/ */
{ {
StgMainThread *m = main_threads; StgMainThread *m = main_threads;
if (m->tso->whatNext == ThreadComplete if (m->tso->what_next == ThreadComplete
|| m->tso->whatNext == ThreadKilled) { || m->tso->what_next == ThreadKilled) {
main_threads = main_threads->link; main_threads = main_threads->link;
if (m->tso->whatNext == ThreadComplete) { if (m->tso->what_next == ThreadComplete) {
/* we finished successfully, fill in the return value */ /* we finished successfully, fill in the return value */
if (m->ret) { *(m->ret) = (StgClosure *)m->tso->sp[0]; }; if (m->ret) { *(m->ret) = (StgClosure *)m->tso->sp[0]; };
m->stat = Success; m->stat = Success;
...@@ -641,7 +641,7 @@ schedule( void ) ...@@ -641,7 +641,7 @@ schedule( void )
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* Run the current thread /* Run the current thread
*/ */
switch (cap->rCurrentTSO->whatNext) { switch (cap->rCurrentTSO->what_next) {
case ThreadKilled: case ThreadKilled:
case ThreadComplete: case ThreadComplete:
/* Thread already finished, return to scheduler. */ /* Thread already finished, return to scheduler. */
...@@ -667,7 +667,7 @@ schedule( void ) ...@@ -667,7 +667,7 @@ schedule( void )
barf("Panic: entered a BCO but no bytecode interpreter in this build"); barf("Panic: entered a BCO but no bytecode interpreter in this build");
#endif #endif
default: default:
barf("schedule: invalid whatNext field");