From cd87528761ec0f2871542d526db9f15d8c6dc3a1 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 26 Feb 2011 00:51:44 +0000 Subject: [PATCH] Add some more explanation to the skip channel example in the MVar docs --- Control/Concurrent/MVar.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 ()) -- 1.7.10.4