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

commits at source.squeak.org commits at source.squeak.org
Sun May 29 13:37:24 UTC 2022


A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-jar.1469.mcz

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

Name: Kernel-jar.1469
Author: jar
Time: 29 May 2022, 3:37:20.04666 pm
UUID: 9b7abd4f-b901-db43-961d-55abbca84437
Ancestors: Kernel-jar.1468

Oops, slight change in #terminate, the rest of Kernel-jar.1468 is unchanged.

=============== Diff against Kernel-jar.1468 ===============

Item was changed:
  ----- Method: Process>>terminate (in category 'changing process state') -----
  terminate 
  	"Stop the process that the receiver represents forever.
  	 Unwind to execute pending #ensure:/#ifCurtailed: blocks before terminating;
  	 allow all unwind blocks to run; if they are currently in progress, let them finish.
  	 If the process is in the middle of a #critical: critical section, release it properly."
  	
  	"This is the kind of behavior we expect when terminating a healthy process.
  	 See further comments in #terminateAggressively and #destroy methods dealing 
  	 with process termination when closing the debugger or after a catastrophic failure."
  	
  	"If terminating the active process, create a parallel stack and run unwinds from there;
  	 if terminating a suspended process, again, create a parallel stack for the process being
  	 terminated and resume the suspended process to complete its termination from the new
  	 parallel stack. Use a priority higher than the active priority to make the process that
  	 invoked the termination wait for its completion."
  
  	"If terminating a suspended process (including runnable and blocked), always suspend
  	 the terminating process first so it doesn't accidentally get woken up. Equally important is
  	 the side effect of the suspension; In 2022 a new suspend semantics has been introduced:
  	 the revised #suspend backs up a process waiting on a conditional variable to the send that
  	 invoked the wait state, while the pre-2022 #suspend simply removed the process from
  	 the conditional variable's list it was previously waiting on; see Process>>suspend comments.
  	 Execute the termination in the ensure argument block to ensure it completes even if the 
  	 terminator process itself gets terminated before it's finished; see testTerminateInTerminate."
  
  	| context |
  	self isActiveProcess ifTrue: [
  		context := thisContext.
  		^[context unwindTo: nil. self suspend] asContext jump].
  
  	[] ensure: [ 
  		self suspendAndReleaseCriticalSection.
  		context := suspendedContext ifNil: [^self].
  		suspendedContext := [context unwindTo: nil. self suspend] asContext.
+ 		self priority: (Processor activePriority + 1 min: Processor highestPriority); resume]!
- 		self priority: Processor activePriority + 1; resume]!



More information about the Squeak-dev mailing list