[project @ 2005-03-30 14:18:24 by simonmar]
[ghc-hetmet.git] / ghc / rts / RtsAPI.c
index c91253b..4ca1225 100644 (file)
@@ -1,5 +1,4 @@
 /* ----------------------------------------------------------------------------
- * $Id: RtsAPI.c,v 1.52 2004/09/03 15:28:39 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2001
  *
@@ -431,11 +430,12 @@ rts_evalStableIO (HsStablePtr s, /*out*/HsStablePtr *ret)
     StgTSO* tso;
     StgClosure *p, *r;
     SchedulerStatus stat;
+    Capability *cap = rtsApiCapability;
+    rtsApiCapability = NULL;
     
     p = (StgClosure *)deRefStablePtr(s);
     tso = createStrictIOThread(RtsFlags.GcFlags.initialStkSize, p);
-    stat = scheduleWaitThread(tso,&r,rtsApiCapability);
-    rtsApiCapability = NULL;
+    stat = scheduleWaitThread(tso,&r,cap);
 
     if (stat == Success && ret != NULL) {
        ASSERT(r != NULL);