
12 Feb
2010
12 Feb
'10
1 p.m.
Jeremy Shaw wrote:
import Control.Concurrent import Control.Concurrent.MVar import System.Posix.Types
data RW = Read | Write
threadWaitReadWrite :: Fd -> IO RW threadWaitReadWrite fd = do m <- newEmptyMVar rid <- forkIO $ threadWaitRead fd >> putMVar m Read wid <- forkIO $ threadWaitWrite fd >> putMVar m Write r <- takeMVar m killThread rid killThread wid return r
Initial testing seems promising. I haven't been able to provoke the "leak" during 15-20 minutes of testing. I'll test more thoroughly during the weekend. Cheers,