On Thu, May 15, 2008 at 2:42 PM, Ronald Guida <<a href="mailto:oddron@gmail.com">oddron@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It looks like a simple race condition to me. You are using<br>
"waitForProcess pid" to wait for runInteractiveCommand to finish, but<br>
you don't seem to have anything that waits for createDefFile to<br>
finish.<br></blockquote><div><br>Thanks Ronald,<br><br>As I could not find a function to wait on a ThreadId I used a MVar to synchronize both threads.<br></div></div><br>> sync <- newEmptyMVar<br>> forkIO (createDefFile sync file out)<br>
> waitForProcess pid<br>> takeMVar sync<br><br>and at the end of the forked thread:<br><br>> putMVar sync ()<br><br>Is this normal or have I missed the `waitOnThreadId` function?<br><br>Thanks for all the comments received on this thread,<br>
<br>Olivier.<br>