'From Squeak3.10.2bc-beta of 16 December 2008 [latest update: #7179] on 24 March 2009 at 11:25:08 pm'!
"Change Set:		ProcessTerminateFix
Date:			23 March 2009
Author:			Andreas Raab

Fixes a problem in Process>>isTerminated which can cause severe problems if the process which is being asked runs at a higher priority than the process asking. In this situation the answer may be incorrect if an external signal occurs while the code is trying to find the bottom context of an executing process."!


!ContextPart methodsFor: 'query' stamp: 'eem 12/31/2008 11:28'!
isBottomContext
	"Answer if this is the last context (the first context invoked) in my sender chain"

	^sender isNil! !


!Process methodsFor: 'accessing' stamp: 'bgf 12/31/2008 11:56'!
isTerminated

	self isActiveProcess ifTrue: [^ false].
	^suspendedContext isNil
	  or: ["If the suspendedContext is the bottomContext it is the block in Process>>newProcess.
		   If so, and the pc is greater than the startpc, the bock has alrteady sent and returned
		   from value and there is nothing more to do."
		suspendedContext isBottomContext
		and: [suspendedContext pc > suspendedContext startpc]]! !

