<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Jaromir --<div><br></div><div>This looks a bit "too clever" for me.</div><div><br></div><div>Process simulation would not work, right? And if we argue that no one wants to simulate a Morphic UI process at that level, I would argue that no Morphic application code should wait for a custom semaphore in the UI loop. ;-) <span style="font-size: 10pt">Let's not forget that CMD+Dot still works so that the application programmer can discover such a mistake.</span></div><div><br></div><div>The fact that we can actually closure the binding while creating it is nice, but do we have to rely on this really to fix our problem?</div><div><br></div><div>The issue is scattered already via #spawnNewProcessIfThisIsUI: and the debugger's errorWasInUIProcess resume logic. If we now obfuscate the that very simple main loop to support yet another edge case ... I hope we can do better. I don't yet see how.</div><div><br></div><div>Finally, I think you actually want to check</div><div><br></div><div>uiProcess == Project current uiProcess</div><div><br></div><div>because</div><div><br></div><div>uiProcess isActiveProcess</div><div><br></div><div>would always be true at that point.</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;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 06.07.2022 10:20:13 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">A new version of Morphic was added to project The Inbox:<br>http://source.squeak.org/inbox/Morphic-jar.2018.mcz<br><br>==================== Summary ====================<br><br>Name: Morphic-jar.2018<br>Author: jar<br>Time: 6 July 2022, 10:19:54.175389 am<br>UUID: 78dd80d9-1174-0c40-ad18-6f76e13e744b<br>Ancestors: Morphic-mt.2017<br><br>Add an "exit condition" to the UI loop to allow a former UI process to finish its last cycle and terminate gracefully. It allows to create a new UI without the need to explicitely terminate the old one because a UI process will terminate automatically once it's replaced by a new one. This change could allow UI proceses blocked on custom semaphores to continue waiting for a signal and finish their previous job (and terminate). Also, it prevents two UI processes to exist at the same time; only the one registered in the 'uiProcess' variable is allowed to cycle.<br><br>Please review for any potential drawbacks or conflicts I may have missed.<br><br>=============== Diff against Morphic-mt.2017 ===============<br><br>Item was changed:<br>  ----- Method: MorphicProject>>spawnNewProcess (in category 'active process') -----<br>  spawnNewProcess<br>  <br>         uiProcess := [<br>+               [world doOneCycle. Processor yield. uiProcess isActiveProcess] whileTrue.<br>-            [world doOneCycle.  Processor yield ] repeat.<br>         ] newProcess priority: Processor userSchedulingPriority.<br>      uiProcess resume!<br><br><br></div></blockquote></div>