--
-----------------------------------------------------------------------------
-#include "config.h"
+#include "ghcconfig.h"
module GHC.Conc
( ThreadId(..)
-- 'putMVar' will wait until it becomes empty.
--
-- If several threads are competing to fill the same 'MVar', one is
--- chosen to continue at random with the 'MVar' becomes empty.
+-- chosen to continue at random when the 'MVar' becomes empty.
putMVar :: MVar a -> a -> IO ()
putMVar (MVar mvar#) x = IO $ \ s# ->
case putMVar# mvar# x s# of
@threadWaitWrite@ is similar, but for writing on a file descriptor.
\begin{code}
--- |The 'threadDelay' operation will cause the current thread to
--- suspend for a given number of microseconds (GHC only).
+-- | Suspends the current thread for a given number of microseconds
+-- (GHC only).
+--
+-- Note that the resolution used by the Haskell runtime system's
+-- internal timer is 1\/50 second, and 'threadDelay' will round its
+-- argument up to the nearest multiple of this resolution.
+--
+-- There is no guarantee that the thread will be rescheduled promptly
+-- when the delay has expired, but the thread will never continue to
+-- run /earlier/ than specified.
--
--- Note that the resolution
--- used by the Haskell runtime system\'s internal timer together with the
--- fact that the thread may take some time to be rescheduled after the
--- time has expired, means that the accuracy is more like 1\/50 second.
threadDelay :: Int -> IO ()
-- | Block the current thread until data is available to read on the