<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi again,</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">                From: Nicolas Cellier</p>
<p class="MsoNormal">                Sent: Sunday, May 8, 2022 18:16</p>
<p class="MsoNormal">                To: The general-purpose Squeak developers list</p>
<p class="MsoNormal">                Subject: Re: [squeak-dev] SIGTRAP when Proceeding from BlockCannotReturn</p>
<p class="MsoNormal">                </p>
<p class="MsoNormal">                > I have the impression that DelayWaitTimeout depends on the old primitiveSuspend (#88) behavior:</p>
<p class="MsoNormal">                </p>
<p class="MsoNormal">                signalWaitingProcess</p>
<p class="MsoNormal">                     "Release the given process from the semaphore it is waiting on.</p>
<p class="MsoNormal">                     This method relies on running at highest priority so that it cannot be preempted</p>
<p class="MsoNormal">                     by the process being released."</p>
<p class="MsoNormal">                     beingWaitedOn := false.</p>
<p class="MsoNormal">                     "Release the process but only if it is still waiting on its original list"</p>
<p class="MsoNormal">                     process suspendingList == delaySemaphore ifTrue:[</p>
<p class="MsoNormal">                         expired := true.</p>
<p class="MsoNormal">                         process suspend; resume.</p>
<p class="MsoNormal">                     ].</p>
<p class="MsoNormal">                > My understanding is that this code assumes that suspending, then resuming will remove the waiting process from the list.</p>
<p class="MsoNormal">                </p>
<p class="MsoNormal">                Yes, that’s exactly the problem; I’m enclosing the fix:</p>
<p class="MsoNormal">                </p>
<p class="MsoNormal">                signalWaitingProcess</p>
<p class="MsoNormal">                                "Release the given process from the semaphore it is waiting on.</p>
<p class="MsoNormal">                                This method relies on running at highest priority so that it cannot be preempted</p>
<p class="MsoNormal">                                by the process being released."</p>
<p class="MsoNormal">                                | list |</p>
<p class="MsoNormal">                                beingWaitedOn := false.</p>
<p class="MsoNormal">                                "Release the process but only if it is still waiting on its original list"</p>
<p class="MsoNormal">                                (list := process suspendingList) == delaySemaphore ifTrue:[</p>
<p class="MsoNormal">                                                expired := true.</p>
<p class="MsoNormal">                                                list remove: self ifAbsent:[].
</p>
<p class="MsoNormal">                                                process offList; resume]</p>
<p class="MsoNormal">                </p>
<p class="MsoNormal">                Maybe it's `list remove: process ifAbsent: []` instead.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Oh my, I have no idea why I put ‘self’ in there :) Thanks!</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">                Excavating offList usage would require an update of its comment...</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ha ha, "excavating offList" :D</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">                Also, see why manipulating the list from within the image might be dangerous</p>
<p class="MsoNormal">                http://forum.world.st/Process-gt-gt-terminate-woes-td69405.html</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you, very interesting... sounds like this fix may be too tricky without using #suspend</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best,</p>
<p class="MsoNormal">Jaromir</p>
</div>
</body>
</html>