diff --git a/ChangeLog b/ChangeLog index e02e849a..62ae7b37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-03-30 Gwenael Casaccio + + * kernel/Process.st: Make Process>>queueInterrupt: atomic. + 2014-03-24 Gwenael Casaccio * kernel/Process.st: Use the correct namespace in diff --git a/kernel/Process.st b/kernel/Process.st index d5931fb6..652b8411 100644 --- a/kernel/Process.st +++ b/kernel/Process.st @@ -310,18 +310,22 @@ can suspend themselves and resume themselves however they wish.'> ^self]. self isTerminated ifTrue: [^SystemExceptions.ProcessTerminated signalOn: self]. - semaphore := myList. - suspended := self isReady not. - block := suspended - ifFalse: - [self suspend. - aBlock] + [ + semaphore := myList. + suspended := self isReady not. + block := suspended + ifFalse: + [self suspend. + aBlock] ifTrue: - [semaphore isNil - ifTrue: [[self evaluate: aBlock ifNotTerminated: [self suspend]]] - ifFalse: [[self evaluate: aBlock ifNotTerminated: [semaphore wait]]]]. - suspendedContext := block asContext: suspendedContext. - self resume] + [ + semaphore isNil + ifTrue: [ [ self evaluate: aBlock ifNotTerminated: [ self suspend ] ] ] + ifFalse: [ [ self evaluate: aBlock ifNotTerminated: [ semaphore wait ] ] ] + ]. + suspendedContext := block asContext: suspendedContext. + self resume + ] valueWithoutPreemption ] ] evaluate: aBlock ifNotTerminated: unwindBlock [