summaryrefslogtreecommitdiff
path: root/ghc/rts/Main.c
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/rts/Main.c')
-rw-r--r--ghc/rts/Main.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ghc/rts/Main.c b/ghc/rts/Main.c
index c6d41702a8..520a757037 100644
--- a/ghc/rts/Main.c
+++ b/ghc/rts/Main.c
@@ -51,11 +51,6 @@ int main(int argc, char *argv[])
startupHaskell(argc,argv,__stginit_ZCMain);
- /* Register this thread as a task, so we can get timing stats about it */
-#if defined(RTS_SUPPORTS_THREADS)
- threadIsTask(osThreadId());
-#endif
-
/* kick off the computation by creating the main thread with a pointer
to mainIO_closure representing the computation of the overall program;
then enter the scheduler with this thread and off we go;
@@ -106,9 +101,12 @@ int main(int argc, char *argv[])
# else /* !PAR && !GRAN */
/* ToDo: want to start with a larger stack size */
- rts_lock();
- status = rts_evalLazyIO((HaskellObj)mainIO_closure, NULL);
- rts_unlock();
+ {
+ void *cap = rts_lock();
+ cap = rts_evalLazyIO(cap,(HaskellObj)mainIO_closure, NULL);
+ status = rts_getSchedStatus(cap);
+ rts_unlock(cap);
+ }
# endif /* !PAR && !GRAN */