[squeak-dev] The Inbox: Kernel-ul.619.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Sep 10 17:39:29 UTC 2011
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ul.619.mcz
==================== Summary ====================
Name: Kernel-ul.619
Author: ul
Time: 10 September 2011, 7:39:00.317 pm
UUID: 7e939691-d828-ac44-9354-44665be1b9e5
Ancestors: Kernel-nice.618
Proposed solution to the Monitor bug (see MonitorTest >> #testMonitorNotGainingUnwantedSignalsDuringUnwinding). The cause of the bug is that the process exits the monitor while it's waiting and it's expected to enter again (see #exitAndWaitInQueue:maxMilliseconds:), but that doesn't happen if the process is terminated. If we ensure that it enters again, then the ensured exit in #critical: won't cause any trouble.
Also ensure that the delay is unscheduled. The goal of this change is to avoid accumulating MonitorDelays and Semaphores when a waiting process is terminated. This is unrelated to the bug described above.
=============== Diff against Kernel-nice.618 ===============
Item was changed:
----- Method: Monitor>>exitAndWaitInQueue:maxMilliseconds: (in category 'private') -----
exitAndWaitInQueue: anOrderedCollection maxMilliseconds: anIntegerOrNil
+
+ [
+ | lock |
+ lock := queuesMutex critical: [ anOrderedCollection addLast: Semaphore new ].
+ self exit.
+ anIntegerOrNil
+ ifNil: [ lock wait ]
+ ifNotNil: [
+ | delay |
+ delay := MonitorDelay
+ signalLock: lock
+ afterMSecs: anIntegerOrNil
+ inMonitor: self
+ queue: anOrderedCollection.
+ [ lock wait ] ensure: [ delay unschedule ] ] ]
+ ensure: [ self enter ]!
- | lock delay |
- lock := queuesMutex
- critical: [anOrderedCollection addLast: Semaphore new].
- self exit.
- anIntegerOrNil ifNil: [
- lock wait
- ] ifNotNil: [
- delay := MonitorDelay signalLock: lock afterMSecs: anIntegerOrNil inMonitor: self queue: anOrderedCollection.
- lock wait.
- delay unschedule.
- ].
- self enter.!
More information about the Squeak-dev
mailing list
|