X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FConc.lhs;h=8965188c5bad2d645e7323194c130aef9b33dfc5;hb=7baaed5bc2be1984669a531dbba9b0325e8a9262;hp=2a24fa5e3c18b9b9284e109fb2e06cfecfee531b;hpb=221834f61e883a17db96bb8b8c0157a3de626738;p=ghc-base.git diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index 2a24fa5..8965188 100644 --- a/GHC/Conc.lhs +++ b/GHC/Conc.lhs @@ -216,7 +216,7 @@ takeMVar (MVar mvar#) = IO $ \ s# -> takeMVar# mvar# s# -- '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 @@ -271,13 +271,17 @@ specified file descriptor is available for reading (just like select). @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