Skip to content

Commit 171651a

Browse files
committed
Minor tweaks (doc fixes, instance Eq Manager)
1 parent e27b4dc commit 171651a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

IOCP/Manager.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ data Manager = Manager
4040
, managerThreadPool :: WorkerList
4141
}
4242

43+
instance Eq Manager where
44+
(==) a b = managerHandles a == managerHandles b
45+
4346
type ManagerCompletionPort = FFI.IOCP (CompletionCallback ())
4447

4548
data HandleState = HandleState
@@ -76,8 +79,8 @@ managerRef = unsafePerformIO $
7679
else newIORef Nothing
7780
{-# NOINLINE managerRef #-}
7881

79-
-- | Nifty trick to allow each 'IOCPHandle' to allocate workers per concurrent
80-
-- task, while allowing all 'IOCPHandles' to share the thread pool as a whole.
82+
-- | Nifty trick to allow each 'HandleState' to allocate workers per concurrent
83+
-- task, while allowing all 'HandleState's to share the thread pool as a whole.
8184
newThreadPool :: IO WorkerList
8285
newThreadPool = unsafeInterleaveIO $ do
8386
w <- Worker.new
@@ -122,7 +125,7 @@ unregister Manager{..} key hstate = do
122125

123126
-- | Close the 'HANDLE' and unregister it from the I/O manager.
124127
-- The callback is run in an exception 'mask', and should not use interruptible
125-
-- operations (e.g. 'takeMVar', 'threadDelay').
128+
-- operations (e.g. 'takeMVar', 'threadDelay', 'System.IO.hClose').
126129
closeHandleWith :: Manager -> (HANDLE -> IO ()) -> HANDLE -> IO ()
127130
closeHandleWith Manager{..} close h =
128131
mask_ $ do

0 commit comments

Comments
 (0)