<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hi Jaromir --<div><br></div><div>What is the current status of this? :-)</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div><blockquote class='history_container' type='cite' style='border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;'>
<p style='color: #AAAAAA; margin-top: 10px;'>Am 21.12.2021 18:14:21 schrieb mail@jaromir.net <mail@jaromir.net>:</p><div style='font-family:Arial,Helvetica,sans-serif'>Hi Eliot, all,
<br>
<br>There's a bug, or rather an omission, in #releaseCriticalSection: causing the following examples unwind incorrectly:
<br>
<br>Mutex new inspect critical: [self halt]
<br>
<br>If you run the example in a workspace, a debugger and an inspector opens - please watch Mutex's 'owner' variable; then step into a few times to get right before sending #primitiveExitCriticalSection and terminate the debugger (in the newest images please use debugger's window menu -> terminate process); and observe the owner won't get cleared and will remain blocking the Mutex. Same behavior for Semaphores:
<br>
<br>Semaphore forMutualExclusion inspect critical: [self halt]
<br>
<br>Again, watch Semaphore's excessSignals variable in the Inspector, step into a few times until you stand before sending #signal - and terminate the debugged process (from the debuggers menu or from the Process Browser if you like) - the Semaphore won't recharge excessSignals back to 1.
<br>
<br>The root cause is #releaseCriticalSection: doesn't account for terminating in this particular position of the computation. It can be fixed e.g. by adding an additional condition ('progressedIntoEnsure') - try the examples with the enclosed changeset; both Mutexes and Semaphores work ok now.
<br>
<br>Best,
<br>
<br>~~~
<br>^[^ Jaromir
<br>
<br>Sent from Squeak Inbox Talk
<br>["Process-releaseCriticalSection.st"]
<br><br></div></blockquote>
</div></body>