summaryrefslogtreecommitdiff
path: root/rts/posix/OSThreads.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-12-06 11:38:07 +0000
committerSimon Marlow <marlowsd@gmail.com>2011-12-06 15:19:18 +0000
commit8b75acd3ca25165536f18976c8d80cb62ad613e4 (patch)
treeccb87f6f5df2af15ca2ca8f65e5163b1f34886b8 /rts/posix/OSThreads.c
parent657773c8e59917fda05ee08065ec566aebb50a5f (diff)
downloadhaskell-8b75acd3ca25165536f18976c8d80cb62ad613e4.tar.gz
Make forkProcess work with +RTS -N
Consider this experimental for the time being. There are a lot of things that could go wrong, but I've verified that at least it works on the test cases we have. I also did some API cleanups while I was here. Previously we had: Capability * rts_eval (Capability *cap, HaskellObj p, /*out*/HaskellObj *ret); but this API is particularly error-prone: if you forget to discard the Capability * you passed in and use the return value instead, then you're in for subtle bugs with +RTS -N later on. So I changed all these functions to this form: void rts_eval (/* inout */ Capability **cap, /* in */ HaskellObj p, /* out */ HaskellObj *ret) It's much harder to use this version incorrectly, because you have to pass the Capability in by reference.
Diffstat (limited to 'rts/posix/OSThreads.c')
-rw-r--r--rts/posix/OSThreads.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c
index cc3baeb1bb..e25cdc1e81 100644
--- a/rts/posix/OSThreads.c
+++ b/rts/posix/OSThreads.c
@@ -197,7 +197,7 @@ forkOS_createThreadWrapper ( void * entry )
{
Capability *cap;
cap = rts_lock();
- cap = rts_evalStableIO(cap, (HsStablePtr) entry, NULL);
+ rts_evalStableIO(&cap, (HsStablePtr) entry, NULL);
taskTimeStamp(myTask());
rts_unlock(cap);
return NULL;