Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make it easier to see what's happening in a callback.

  • Loading branch information...
commit 09efa2d0bc84272efb66ddedaebda03d381bf2da 1 parent 6a3ed75
@bos bos authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 benchmarks/Simple.hs
View
4 benchmarks/Simple.hs
@@ -56,21 +56,21 @@ defaultOptions = [
readCallback :: MVar () -> IORef Int -> Fd -> [Event] -> IO ()
readCallback done ref fd _ = do
a <- atomicModifyIORef ref (\a -> let !b = a+1 in (b,b))
+ print ("read",fd,a)
if a > 10
then do
close fd
putMVar done ()
else do
- print ("read",fd)
readByte fd
writeCallback :: IORef Int -> Fd -> [Event] -> IO ()
writeCallback ref fd _ = do
a <- atomicModifyIORef ref (\a -> let !b = a+1 in (b,b))
+ print ("write",fd,a)
if a > 10
then close fd
else do
- print ("write",fd)
writeByte fd
main :: IO ()
Please sign in to comment.
Something went wrong with that request. Please try again.