On Thu, May 15, 2008 at 2:42 PM, Ronald Guida &lt;<a href="mailto:oddron@gmail.com">oddron@gmail.com</a>&gt; 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. &nbsp;You are using<br>
&quot;waitForProcess pid&quot; to wait for runInteractiveCommand to finish, but<br>
you don&#39;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>&gt;&nbsp;&nbsp; sync &lt;- newEmptyMVar<br>&gt;&nbsp;&nbsp; forkIO (createDefFile sync file out)<br>
&gt;&nbsp;&nbsp; waitForProcess pid<br>&gt;&nbsp;&nbsp; takeMVar sync<br><br>and at the end of the forked thread:<br><br>&gt;&nbsp;&nbsp; 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>