From e0243d8af333996441d6fb814f3c74bbf99b8dc3 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 7 Nov 2006 11:14:30 +0000 Subject: [PATCH] Update documentation for hWaitForInput See #972 Merge to 6.6 branch. --- GHC/IO.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/GHC/IO.hs b/GHC/IO.hs index f248914..096cff0 100644 --- a/GHC/IO.hs +++ b/GHC/IO.hs @@ -64,13 +64,15 @@ import GHC.Conc -- or 'False' if no input is available within @t@ milliseconds. -- -- If @t@ is less than zero, then @hWaitForInput@ waits indefinitely. --- NOTE: in the current implementation, this is the only case that works --- correctly (if @t@ is non-zero, then all other concurrent threads are --- blocked until data is available). -- -- This operation may fail with: -- -- * 'isEOFError' if the end of file has been reached. +-- +-- NOTE for GHC users: unless you use the @-threaded@ flag, +-- @hWaitForInput t@ where @t >= 0@ will block all other Haskell +-- threads for the duration of the call. It behaves like a +-- @safe@ foreign call in this respect. hWaitForInput :: Handle -> Int -> IO Bool hWaitForInput h msecs = do -- 1.7.10.4