Skip to content
This repository has been archived by the owner on Dec 17, 2020. It is now read-only.

Commit

Permalink
Using safe foreign call for connectNamedPipe
Browse files Browse the repository at this point in the history
Since connectNamedPipe is basically a wait/sleep function, we need to
use *safe* foreign call, because they delay the GC sync.

For example see Simon Marlow's comment:

  haskell/unix#34 (comment)
  • Loading branch information
trskop committed Oct 13, 2016
1 parent c296fd7 commit 214a492
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/System/Win32/NamedPipes/Internal.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ connectNamedPipe h =
-- _Inout_opt_ LPOVERLAPPED lpOverlapped
-- );
-- @
foreign import ccall unsafe "windows.h ConnectNamedPipe"
--
-- Since this is basically a wait\/sleep function, we need to use *safe*
-- foreign call, because they delay the GC sync.
foreign import ccall safe "windows.h ConnectNamedPipe"
c_ConnectNamedPipe
:: HANDLE
-> LPOVERLAPPED
Expand Down

0 comments on commit 214a492

Please sign in to comment.