diff options
author | Bertram Felgenhauer <int-e@gmx.de> | 2014-11-18 12:15:33 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-11-18 12:15:33 -0600 |
commit | ddb484c2335c75f8fd767f54377e418db400aede (patch) | |
tree | 7734128db7fc75e473c8278a230c08675a95b48f | |
parent | 1f6b1ab4b6d7203481bfaf374b014972f7756fb2 (diff) | |
download | haskell-ddb484c2335c75f8fd767f54377e418db400aede.tar.gz |
Update comment about C helper for foreign exports (#9713)
Signed-off-by: Austin Seipp <austin@well-typed.com>
-rw-r--r-- | compiler/deSugar/DsForeign.lhs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/deSugar/DsForeign.lhs b/compiler/deSugar/DsForeign.lhs index c60e9146bc..311069ec67 100644 --- a/compiler/deSugar/DsForeign.lhs +++ b/compiler/deSugar/DsForeign.lhs @@ -398,12 +398,16 @@ f cback = foreign import "&f_helper" f_helper :: FunPtr (StablePtr Fun -> Fun) --- and the helper in C: +-- and the helper in C: (approximately; see `mkFExportCBits` below) f_helper(StablePtr s, HsBool b, HsInt i) { - rts_evalIO(rts_apply(rts_apply(deRefStablePtr(s), + Capability *cap; + cap = rts_lock(); + rts_evalIO(&cap, + rts_apply(rts_apply(deRefStablePtr(s), rts_mkBool(b)), rts_mkInt(i))); + rts_unlock(cap); } \end{verbatim} |