
15 May
2008
15 May
'08
7:06 p.m.
On Thu, May 15, 2008 at 2:42 PM, Ronald Guida
It looks like a simple race condition to me. You are using "waitForProcess pid" to wait for runInteractiveCommand to finish, but you don't seem to have anything that waits for createDefFile to finish.
Thanks Ronald, As I could not find a function to wait on a ThreadId I used a MVar to synchronize both threads.
sync <- newEmptyMVar forkIO (createDefFile sync file out) waitForProcess pid takeMVar sync
and at the end of the forked thread:
putMVar sync ()
Is this normal or have I missed the `waitOnThreadId` function? Thanks for all the comments received on this thread, Olivier.