Hello Haskellers,

I have two questions for you:

* Is there a Haskell binding to the ualarm() function in unistd.h?  I looked in 
System.Posix.Signals, but there's just a binding for alarm().

* Is there a way to interrupt a blocking operation on another thread?  I 
thought about throwTo, but that seems like overkill.  Here's some example code:

import Control.Concurrent

main :: IO ()
main = do
    tid <- myThreadId
    forkIO $ interruptMain tid
    getChar

interruptMain :: ThreadId -> IO ()
interruptMain mainThreadId = do
    threadDelay 5000000
    interrupt mainThreadId -- This is probably going to end up being throwTo, 
isn't it?
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to