/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.105 2001/11/08 12:46:31 simonmar Exp $
+ * $Id: Schedule.c,v 1.106 2001/11/08 16:17:35 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
* ------------------------------------------------------------------------- */
StgInt
-suspendThread( Capability *cap )
+suspendThread( StgRegTable *reg )
{
nat tok;
+ Capability *cap;
+
+ // assume that *reg is a pointer to the StgRegTable part of a Capability
+ cap = (Capability *)((void *)reg - sizeof(StgFunTable));
ACQUIRE_LOCK(&sched_mutex);
return tok;
}
-Capability *
+StgRegTable *
resumeThread( StgInt tok )
{
StgTSO *tso, **prev;
cap->r.rCurrentTSO = tso;
RELEASE_LOCK(&sched_mutex);
- return cap;
+ return &cap->r;
}