<div dir="ltr">Just found out that, the two functions of waitForEvent and waitForError cannot be run in "main" thread. I just forked them and used a getChar to block the program, and everything just went smooth. No idea what to proceed....</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 4, 2015 at 8:59 PM, Magicloud Magiclouds <span dir="ltr"><<a href="mailto:magicloud.magiclouds@gmail.com" target="_blank">magicloud.magiclouds@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br><div>  I met an issue while I was using xhb. When a certain property of root window being changed, it was supposed to give me an AccessError. But actually I got "<span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185303px">thread blocked indefinitely in an STM transaction" when I waitForEvent.</span></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif"><span style="font-size:14px;line-height:22.3999996185303px"><br></span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif"><span style="font-size:14px;line-height:22.3999996185303px">  AFAIK, in xhb, it forks a thread to read what X server sends. Then parse and put it into a TChan. waitForEvent reads from the TChan.</span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif"><span style="font-size:14px;line-height:22.3999996185303px"><br></span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif"><span style="font-size:14px;line-height:22.3999996185303px">  It is reasonable to me that if X server did not send anything, then waitForEvent would be blocked. But apparently there are some other policies in RTS.</span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif"><span style="font-size:14px;line-height:22.3999996185303px"><br></span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif"><span style="font-size:14px;line-height:22.3999996185303px">  So what is that? And how should I debug it?<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></span></font><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div>竹密岂妨流水过<br>山高哪阻野云飞<br><br>And for G+, please use magiclouds#<a href="http://gmail.com" target="_blank">gmail.com</a>.</div>
</font></span></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">竹密岂妨流水过<br>山高哪阻野云飞<br><br>And for G+, please use magiclouds#<a href="http://gmail.com" target="_blank">gmail.com</a>.</div>
</div>