- tidy up TICK_ALLOC_TSO() uses.
- scheduleThread: remove special-case for END_TSO_QUEUE. If you want
to call schedule(), do so directly. (Only one of the scheduleThread()
call sites depended on this feature).
/* ---------------------------------------------------------------------------
/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.108 2001/11/26 16:54:22 simonmar Exp $
+ * $Id: Schedule.c,v 1.109 2001/12/07 20:57:53 sof Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* (c) The GHC Team, 1998-2000
*
stack_size = size - TSO_STRUCT_SIZEW;
tso = (StgTSO *)allocate(size);
stack_size = size - TSO_STRUCT_SIZEW;
tso = (StgTSO *)allocate(size);
- TICK_ALLOC_TSO(size-TSO_STRUCT_SIZEW, 0);
+ TICK_ALLOC_TSO(stack_size, 0);
SET_HDR(tso, &stg_TSO_info, CCS_SYSTEM);
#if defined(GRAN)
SET_HDR(tso, &stg_TSO_info, CCS_SYSTEM);
#if defined(GRAN)
void
scheduleThread(StgTSO *tso)
{
void
scheduleThread(StgTSO *tso)
{
- if (tso==END_TSO_QUEUE){
- schedule();
- return;
- }
-
ACQUIRE_LOCK(&sched_mutex);
/* Put the new thread on the head of the runnable queue. The caller
ACQUIRE_LOCK(&sched_mutex);
/* Put the new thread on the head of the runnable queue. The caller
void
taskStart(void) /* ( void *arg STG_UNUSED) */
{
void
taskStart(void) /* ( void *arg STG_UNUSED) */
{
- scheduleThread(END_TSO_QUEUE);
IF_DEBUG(scheduler, fprintf(stderr,"== scheduler: increasing stack size from %d words to %d.\n", tso->stack_size, new_stack_size));
dest = (StgTSO *)allocate(new_tso_size);
IF_DEBUG(scheduler, fprintf(stderr,"== scheduler: increasing stack size from %d words to %d.\n", tso->stack_size, new_stack_size));
dest = (StgTSO *)allocate(new_tso_size);
- TICK_ALLOC_TSO(new_tso_size-sizeofW(StgTSO),0);
+ TICK_ALLOC_TSO(new_stack_size,0);
/* copy the TSO block and the old stack into the new area */
memcpy(dest,tso,TSO_STRUCT_SIZE);
/* copy the TSO block and the old stack into the new area */
memcpy(dest,tso,TSO_STRUCT_SIZE);