[squeak-dev] The Trunk: Kernel-jar.1477.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Jun 9 08:15:55 UTC 2022
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-jar.1477.mcz
==================== Summary ====================
Name: Kernel-jar.1477
Author: jar
Time: 8 June 2022, 1:18:13.217988 pm
UUID: cde25b8e-8f6a-4241-8f6e-67a9ae27da68
Ancestors: Kernel-jar.1476
Setting suspendedContext may ruin your image; add checks to prevent such situations. Add examples and coments documenting disastrous situations.
Supersede Kernel-jar.1474.
Updated test will follow later.
=============== Diff against Kernel-jar.1476 ===============
Item was changed:
----- Method: Process>>suspendedContext: (in category 'private') -----
+ suspendedContext: aContextOrNil
+ "Set suspendedContext; proceed with caution when assigning nil or when process priority is undefined."
+
+ "Note: Assigning nil to a runnable but not active process would freeze the image when self is scheduled to run.
+
+ Workspace example:
+ These two lines (executed at once, not line by line)
+ p := [] newProcess resume.
+ p suspendedContext: nil
+ will freeze the image; the first line puts p in the run queue, the second line niles p's suspendedContext and
+ when the UI cycles, p tries to run with niled suspendedContext and the image freezes as a result.
+
+ Assigning 'suspendedContext' before 'priority' is defined may cause a disaster when Process Browser is open
+ with auto-update on; once the 'suspendedContext' is set, the new process is no longer considered terminated
+ and Process Browser will try to place it in its list of processes but encounters a nil error when reading its priority
+ because it has not been set yet.
+
+ Workspace example:
+ If you run the following line with Process Browser open and auto-update on, you'll ruin your image:
+ p := Process new suspendedContext: [self] asContext
+ Every second a new debugger window pops up and the only way out is to kill the image in the OS.
+
+ As a precautionary measure set 'priority' if undefined to the active process priority before setting
+ 'suspendedContext'."
- suspendedContext: aContext
- "Note: assigning nil to a runnable but not active process would freeze the image when self is scheduled to run."
+ priority ifNil: [priority := Processor activePriority].
+ suspendedContext := aContextOrNil ifNil: [self suspend. nil]!
- suspendedContext := aContext ifNil: [self suspend. nil]!
More information about the Squeak-dev
mailing list
|