[project @ 2005-05-27 14:47:08 by tharris]
[ghc-hetmet.git] / ghc / rts / RtsAPI.c
index 4ca1225..0a6b42e 100644 (file)
@@ -8,13 +8,13 @@
 
 #include "PosixSource.h"
 #include "Rts.h"
+#include "OSThreads.h"
 #include "Storage.h"
 #include "RtsAPI.h"
 #include "SchedAPI.h"
 #include "RtsFlags.h"
 #include "RtsUtils.h"
 #include "Prelude.h"
-#include "OSThreads.h"
 #include "Schedule.h"
 #include "Capability.h"
 
@@ -199,9 +199,9 @@ rts_mkString (char *s)
 HaskellObj
 rts_apply (HaskellObj f, HaskellObj arg)
 {
-    StgClosure *ap;
+    StgThunk *ap;
 
-    ap = (StgClosure *)allocate(sizeofW(StgClosure) + 2);
+    ap = (StgThunk *)allocate(sizeofW(StgThunk) + 2);
     SET_HDR(ap, (StgInfoTable *)&stg_ap_2_upd_info, CCS_SYSTEM);
     ap->payload[0] = f;
     ap->payload[1] = arg;
@@ -501,6 +501,8 @@ rts_lock()
     // b) wake the current worker thread from awaitEvent()
     //       (so that a thread started by rts_eval* will start immediately)
     waitForReturnCapability(&sched_mutex,&rtsApiCapability);
+#else
+    grabCapability(&rtsApiCapability);
 #endif
 }