On Thu, May 15, 2008 at 2:42 PM, Ronald Guida <oddron@gmail.com> wrote:
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.