<div dir="ltr"><div>Hi.</div><div><br></div>Current logic is:<div><br></div><div>- primitiveEnterCriticalSection returns true if section is already entered inside same Process (when recursive call happens). It returns false when new lock on critical section acquired</div><div>- primitiveTestAndSetOwnershipOfCriticalSection returns true if section is already entered inside same Process (when recursive call happens). It returns false when new lock on critical section acquired. It returns nil when section locked by other process.</div><div><br></div><div>Users of this code must handle process termination carefully which required local variable which track current lock state:</div><div><br></div><div>[lockState := section primitiveEnterCriticalSection.</div><div>some code]</div><div>   ensure: [&quot;condition around lockState&quot; section primitiveExitCriticalSection ]</div><div><br></div><div>With current logic of primitives it is not easy to give this variable intuitive name. You can&#39;t name it exitRequired or sectionEnteredHere because primitive returns opposite value.</div><div><br></div><div>Can we invert this primitive return values? It will make users code cleaner and easy to understand.</div><div><br></div><div>This primitives are not used in Pharo or Squeak yet. I push change for Pharo. But now I have thoughts that it is better to change primitives before we will start use it.</div><div><br></div><div>What you think?</div></div>