<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace"><span style="font-family:arial">2014-09-18 19:34 GMT+08:00 Michael Schnell </span><span dir="ltr" style="font-family:arial"><<a href="mailto:mschnell@lumino.de" target="_blank">mschnell@lumino.de</a>></span><span style="font-family:arial">:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div><br></div>
I think, in the other mail, I did explain how "Wait" is supposed to
work in TThreadPool. <br><span class="HOEnZb"><font color="#888888"><br></font></span></div></blockquote><div><br></div><div class="gmail_default" style="font-family:'courier new',monospace">Initially, when the threadpool is created, Wait is hold by the main thread, so the worker just wait there, no problem, but after the worker thread get the CS, it started working, then RELEASE the CS.</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">This is when the problem arise: after worker release the CS, how do you ensure it is the MAIN thread who will get the CS next, NOT the worker thread again?</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">That is my question, which I don't think you answered.</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">Thanks,</div><div class="gmail_default" style="font-family:'courier new',monospace">Xiangrong</div></div></div></div>