<br><br><div class="gmail_quote">On Feb 12, 2008 11:01 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>&gt; Anyway, I understand what you mean now. This looks like an implementation<br>&gt; issue of your canvas, so the thread protection should be encapsulated inside<br>&gt; it.<br>&gt;<br>&gt; I.e.<br>
&gt;<br>&gt; myMutex critical: [<br>&gt; &nbsp; &nbsp; gl changeSomeState.<br>&gt; &nbsp; &nbsp; ..some code..<br>&gt; &nbsp; &nbsp; gl revertToPreviousState.<br>&gt; ].<br>&gt;<br><br></div>It&#39;s still unsafe. Tell you why:<br><br>myMutex critical: [<br>
 &nbsp; &nbsp; gl changeSomeState.<br> &nbsp; &nbsp; aBlock value.<br> &nbsp; &nbsp; gl revertToPreviousState.<br>&nbsp;].<br><br>while block still can contain evil forks...<br><div><div class="Wj3C7c"><br></div></div></blockquote></div><br><br>Yea, well, don&#39;t evaluate untrusted blocks in critical regions :-).<br>
<br>And forks aren&#39;t evil. They&#39;re quite nice, really; try doing the same in Java or C!<br><br>Gulik.<br clear="all"><br>-- <br><a href="http://people.squeakfoundation.org/person/mikevdg">http://people.squeakfoundation.org/person/mikevdg</a><br>
<a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a>