From: Ian Lynagh Date: Sat, 26 Feb 2011 00:51:44 +0000 (+0000) Subject: Add some more explanation to the skip channel example in the MVar docs X-Git-Url: http://git.megacz.com/?p=ghc-base.git;a=commitdiff_plain;h=cd87528761ec0f2871542d526db9f15d8c6dc3a1 Add some more explanation to the skip channel example in the MVar docs --- diff --git a/Control/Concurrent/MVar.hs b/Control/Concurrent/MVar.hs index 4e31f46..3a38294 100644 --- a/Control/Concurrent/MVar.hs +++ b/Control/Concurrent/MVar.hs @@ -70,9 +70,11 @@ -- most recent value, or blocks if there are no new values. Multiple -- readers are supported with a @dupSkipChan@ operation. -- --- A skip channel is a pair of 'MVar's: the second 'MVar' is a semaphore --- for this particular reader: it is full if there is a value in the --- channel that this reader has not read yet, and empty otherwise. +-- A skip channel is a pair of 'MVar's. The first 'MVar' contains the +-- current value, and a list of semaphores that need to be notified +-- when it changes. The second 'MVar' is a semaphore for this particular +-- reader: it is full if there is a value in the channel that this +-- reader has not read yet, and empty otherwise. -- -- @ -- data SkipChan a = SkipChan (MVar (a, [MVar ()])) (MVar ())