diff options
author | Gabor Greif <ggreif@gmail.com> | 2014-08-08 18:01:19 +0200 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2014-08-08 18:01:19 +0200 |
commit | 5f003d228340c3ce8e500f9053f353c58dc1dc94 (patch) | |
tree | a855b0f173ff635b48354e1136ef6cbb2a1214a4 /rts/Schedule.c | |
parent | ff9c5570395bcacf8963149b3a8475f5644ce694 (diff) | |
parent | dff0623d5ab13222c06b3ff6b32793e05b417970 (diff) | |
download | haskell-wip/generics-propeq.tar.gz |
Merge branch 'master' into wip/generics-propeqwip/generics-propeq
Conflicts:
compiler/typecheck/TcGenGenerics.lhs
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r-- | rts/Schedule.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c index adf2b5cb39..ad1cffc1a5 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1802,6 +1802,10 @@ forkProcess(HsStablePtr *entry ACQUIRE_LOCK(&capabilities[i]->lock); } +#ifdef THREADED_RTS + ACQUIRE_LOCK(&all_tasks_mutex); +#endif + stopTimer(); // See #4074 #if defined(TRACING) @@ -1823,13 +1827,18 @@ forkProcess(HsStablePtr *entry releaseCapability_(capabilities[i],rtsFalse); RELEASE_LOCK(&capabilities[i]->lock); } + +#ifdef THREADED_RTS + RELEASE_LOCK(&all_tasks_mutex); +#endif + boundTaskExiting(task); // just return the pid return pid; } else { // child - + #if defined(THREADED_RTS) initMutex(&sched_mutex); initMutex(&sm_mutex); @@ -1839,6 +1848,8 @@ forkProcess(HsStablePtr *entry for (i=0; i < n_capabilities; i++) { initMutex(&capabilities[i]->lock); } + + initMutex(&all_tasks_mutex); #endif #ifdef TRACING @@ -1926,8 +1937,7 @@ forkProcess(HsStablePtr *entry rts_checkSchedStatus("forkProcess",cap); rts_unlock(cap); - hs_exit(); // clean up and exit - stg_exit(EXIT_SUCCESS); + shutdownHaskellAndExit(EXIT_SUCCESS, 0 /* !fastExit */); } #else /* !FORKPROCESS_PRIMOP_SUPPORTED */ barf("forkProcess#: primop not supported on this platform, sorry!\n"); @@ -2858,3 +2868,11 @@ resurrectThreads (StgTSO *threads) } } } + +// Local Variables: +// mode: C +// fill-column: 80 +// indent-tabs-mode: nil +// c-basic-offset: 4 +// buffer-file-coding-system: utf-8-unix +// End: |