<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 <<a href="mailto:marcus.denker@inria.fr" class="">marcus.denker@inria.fr</a>> 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="">
"The finalization process arranges to send mourn to each element
of the VM's finalization queue,
<br class="">
which is accessed via primitiveFetchMourner. The VM signals
FinalizationSemaphore whenever
<br class="">
the queue is non-empty. This process loops, waiting on the
semaphore, fetches the first element
<br class="">
of the queue and then spawns a process at a higher priority to
acually send the mourn messages.
<br class="">
If an error occurs in the higher priority mourn loop process
then this process will simply spawn
<br class="">
another process, hence ensuring that errors in finalization
methods don't break finalization.
<br class="">
<br class="">
In addition this process also runs the old finalization scheme,
supporting clients of the older,
<br class="">
WeakRegistry based scheme. Hopefully this will go away when
all cleints have moved over."
<br class="">
| throttle firstMourner |
<br class="">
throttle := Semaphore new.
<br class="">
[FinalizationSemaphore wait; initSignals.
<br class="">
"Support the old scheme until things have changed over..."
<br class="">
self doOldFinalization.
<br class="">
[firstMourner := self primitiveFetchMourner.
<br class="">
firstMourner notNil] whileTrue:
<br class="">
[[throttle signal.
<br class="">
self mournLoopWith: firstMourner] forkAt: Processor
activePriority + 1.
<br class="">
throttle wait]]<br class=""></div></blockquote><div class=""><br class=""></div></span><div class="">Doh! So I wrote a naked block, not a loop !! So it did nothing. Thank you!! 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 </div><div class=""><span class="" style="white-space:pre">                </span>matches: '`{:node | node isBlock and: [node parent isSequence </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 </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"><Dead.jpg></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=""> 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>