[squeak-dev] The Inbox: Kernel-jar.1470.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon May 30 12:13:24 UTC 2022

+1000 Thanks! :-)

Just #testPrimitive100 is not passing ... is this expected?

Am 29.05.2022 22:51:49 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Kernel was added to project The Inbox:

==================== Summary ====================

Name: Kernel-jar.1470
Author: jar
Time: 29 May 2022, 10:51:34.061501 pm
UUID: 18469d29-2a9e-074d-b7e3-12d8d981f4b5
Ancestors: Kernel-jar.1469

one more oops; check suspendedContext for nil

=============== Diff against Kernel-jar.1469 ===============

Item was changed:
----- Method: Process>>suspendAndReleaseCriticalSection (in category 'private') -----
"Figure out if we are terminating a process that is in the ensure: block of a critical section.
If it hasn't made progress but is beyond the wait (which we can tell by the oldList being
one of the runnable lists, i.e. a LinkedList, not a Semaphore or Mutex, et al), then the ensure:
block needs to be run."

| oldList selectorJustSent |
"Suspend and unblock the receiver from a condition variable using suspend primitive #88.
It answers the list the receiver was on before the suspension."
oldList := self suspendAndUnblock.
(oldList isNil or: [oldList class == LinkedList]) ifFalse: [^self].

+ ((suspendedContext ifNil: [^self]) method pragmaAt: #criticalSection) ifNil: [^self].
- (suspendedContext method pragmaAt: #criticalSection) ifNil: [^self].
selectorJustSent := suspendedContext selectorJustSentOrSelf.

"If still at the wait the ensure: block has not been activated, so signal to restore."
selectorJustSent == #wait ifTrue:
[suspendedContext receiver signal].

"If still at the lock primitive and the lock primitive just acquired ownership (indicated by it answering false)
then the ensure block has not been activated, so explicitly primitiveExitCriticalSection to unlock."
(selectorJustSent == #primitiveEnterCriticalSection
or: [selectorJustSent == #primitiveTestAndSetOwnershipOfCriticalSection]) ifTrue:
[(suspendedContext stackPtr > 0
and: [suspendedContext top == false]) ifTrue:
[suspendedContext receiver primitiveExitCriticalSection]]!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220530/ea9e5cd6/attachment.html>

More information about the Squeak-dev mailing list