There are two threads, one which is waits on input via
hGetLine
and another, which should terminate this thread or close this handle.
like this? The trick is to fork the blocking call (hGetLine)
and wait on an MVar. That way, the kill signal can be handled:
{-# language PatternSignatures
Hello,
The simplified problem:
There are two threads, one which is waits on input via
hGetLine
and another, which should terminate this thread or close this handle.
hClose
as well as
killThread
doesn't seem to work, caused by the fact, that the thread is blocked until input
is availiable.
Hi --
I am not well-versed in Haskell-specific multi-threading, but usually there
is a better way to do what you want that does not involve killing threads
(which in most cases is bad idea.)
For example, using non-blocking IO and e.g. a synchronized condition
variable; hWaitForInput might work
On Sat, Apr 28, 2012 at 2:23 PM, H. M. h._h._...@hotmail.com wrote:
There are two threads, one which is waits on input via
hGetLine
and another, which should terminate this thread or close this handle.
hClose
as well as
killThread
doesn't seem to work, caused by the fact, that the thread