Skip to content

Commit

Permalink
kernel: Make Process>> queueInterrupt: atomic.
Browse files Browse the repository at this point in the history
2014-03-30  Gwenael Casaccio  <gwenael.casaccio@gmail.com>

	* kernel/Process.st: Make Process>>queueInterrupt: atomic.
  • Loading branch information
Gwenael Casaccio authored and zecke committed Apr 4, 2014
1 parent 08c7f89 commit 45bd9c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
2014-03-30 Gwenael Casaccio <gwenael.casaccio@gmail.com>

* kernel/Process.st: Make Process>>queueInterrupt: atomic.

2014-03-24 Gwenael Casaccio <gwenael.casaccio@gmail.com>

* kernel/Process.st: Use the correct namespace in
Expand Down
26 changes: 15 additions & 11 deletions kernel/Process.st
Expand Up @@ -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 [
Expand Down

0 comments on commit 45bd9c3

Please sign in to comment.