Possible Bug with Process terminate
Eric Arseneau
eat at huv.com
Sat Jun 24 03:39:14 UTC 2000
I'm using Squeak 2.7.
I am trying to override Project>>#enter:revert:saveForRevert: in my own
custom project class. I have my reasons for this. My override used to look
something like
enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
| currentProcess |
currentProcess := Processor activeProcess.
[[currentProcess suspendedContext isNil] whileFalse: [
(Delay forMilliseconds: 200) wait].
Transcript cr; show: 'Hello there'] fork.
^super enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
The reason for the funky stuff going on with the fork, is that the super
call causes the currently active process to be terminated. So I need to get
some stuff done after the super is done. One way to do this would to clone
the entire method and add the stuff I need. But I don't wish to do this.
But it turns out that the above code does not actually work. The reason is
that currentProcess is nil after the active process is terminated. Am I
missing something here. Is the context of the forked block removed while
there is still a reference to it ? What I've had to do is to make the code
look like
enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
| currentProcess |
currentProcess := Processor activeProcess.
[[currentProcess isNil] whileFalse: [
(Delay forMilliseconds: 200) wait].
Transcript cr; show: 'Hello there'] fork.
^super enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
Here I actually check for the currentProcess temp variable. In theory, I
could put anything into that temp and this would work.
Is this a bug ? Am I missing something here ? Is it fixed in more recent
releases ?
More information about the Squeak-dev
mailing list
|