<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Maybe I will find some time to hack the tree-matching rules to highlight the matched piece of code. It’s so frustrating that they don’t do it…</div><div class=""><br class=""></div><div class="">Uko</div><br class=""><div><blockquote type="cite" class=""><div class="">On 30 Jun 2016, at 10:17, Marcus Denker &lt;<a href="mailto:marcus.denker@inria.fr" class="">marcus.denker@inria.fr</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF" class="">
    <br class="">
    finalizationProcess
<br class="">
    &nbsp;&nbsp;&nbsp; "The finalization process arranges to send mourn to each element
    of the VM's finalization queue,
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;which is accessed via primitiveFetchMourner.&nbsp; The VM signals
    FinalizationSemaphore whenever
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;the queue is non-empty.&nbsp; This process loops, waiting on the
    semaphore, fetches the first element
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;of the queue and then spawns a process at a higher priority to
    acually send the mourn messages.
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;If an error occurs in the higher priority mourn loop process
    then this process will simply spawn
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;another process, hence ensuring that errors in finalization
    methods don't break finalization.
<br class="">
    &nbsp;<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;In addition this process also runs the old finalization scheme,
    supporting clients of the older,
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;WeakRegistry based scheme.&nbsp; Hopefully this will go away when
    all cleints have moved over."
<br class="">
    &nbsp;&nbsp;&nbsp; | throttle firstMourner |
<br class="">
    &nbsp;&nbsp;&nbsp; throttle := Semaphore new.
<br class="">
    &nbsp;&nbsp;&nbsp; [FinalizationSemaphore wait; initSignals.
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;"Support the old scheme until things have changed over..."
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;self doOldFinalization.
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;[firstMourner := self primitiveFetchMourner.
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp; firstMourner notNil] whileTrue:
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [[throttle signal.
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; self mournLoopWith: firstMourner] forkAt: Processor
    activePriority + 1.
<br class="">
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;throttle wait]]<br class=""></div></blockquote><div class=""><br class=""></div></span><div class="">Doh!&nbsp; So I wrote a naked block, not a loop !! So it did nothing.&nbsp; Thank you!!&nbsp; I think the compiler should warn about naked blocks.</div><div class=""><div class="h5"><div class=""><br class=""></div></div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">I added a new Code-Critic rule "RBDeadBlockRule", with</div><div class=""><br class=""></div><div class=""><div class="">initialize</div><div class=""><span class="" style="white-space:pre">        </span>super initialize.</div><div class=""><span class="" style="white-space:pre">        </span>self matcher&nbsp;</div><div class=""><span class="" style="white-space:pre">                </span>matches: '`{:node | node isBlock and: [node parent isSequence&nbsp;</div><div class=""><span class="" style="white-space:pre">                        </span>and: [ node isLastStatementInBlock not ]]}'</div><div class=""><span class="" style="white-space:pre">                </span>do: [ :node :answer | node ]</div></div><div class=""><br class=""></div><div class="">This now shows a warning in the tools (the explanation is shown when clicking on the ? button):</div><div class="">It does not yet highlight the block and has no automatic transformation to fix the problem, but as&nbsp;</div><div class="">a first step it should be nice to have.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><span id="cid:ii_155a05c9118e7881">&lt;Dead.jpg&gt;</span><br class=""></div><div class=""><br class=""></div><div class="">This is in 60 update 126.</div><div class=""><br class=""></div><div class="">(I did not read the mail again before doing it, so now it is called "dead", not "naked", we can change</div><div class="">that... dead somehow makes it look to be related a "dead context"...).</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;Marcus</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div>
</div></div>
</div></blockquote></div><br class=""></body></html>