SampleVar semantics, documentation vs. source

Hi, doc: http://www.haskell.org/ghc/docs/7.0-latest/html/libraries/base-4.3.0.0/Contr... source: http://www.haskell.org/ghc/docs/7.0-latest/html/libraries/base-4.3.0.0/src/C... The documentation for Control.Concurrent.SampleVar implies that a SampleVar is either "filled" or "empty". The source code suggests that there are three possible states: "full" (when readers == 1), "empty" (when readers == 0), and "empty with blocked readers" (when readers < 0). In particular, the isEmptySampleVar function, isEmptySampleVar :: SampleVar a -> IO Bool isEmptySampleVar (SampleVar svar) = do (readers, _) <- readMVar svar return (readers == 0) returns false in the third state, when readers < 0. Can someone clarify the semantics of SampleVar? Thanks, Eric
participants (1)
-
Eric Stansifer