230 |
230 |
231 for:aBlock priority:aPrio |
231 for:aBlock priority:aPrio |
232 "setup the new process - the receiver is not scheduled for |
232 "setup the new process - the receiver is not scheduled for |
233 execution, to get it running, send it #resume" |
233 execution, to get it running, send it #resume" |
234 |
234 |
235 |nm| |
235 |nm active| |
236 |
236 |
237 prio := aPrio. |
237 prio := aPrio. |
238 startBlock := aBlock. |
238 startBlock := aBlock. |
|
239 restartable := false. |
239 |
240 |
240 (Processor newProcessFor:self) ifFalse:[ |
241 (Processor newProcessFor:self) ifFalse:[ |
241 "for some reason, the Processor was unable to create |
242 "for some reason, the Processor was unable to create |
242 a VM process for me ...." |
243 a VM process for me ...." |
243 ^ nil |
244 ^ nil |
244 ]. |
245 ]. |
245 |
246 |
246 " |
247 " |
247 give me a user-friendly name |
248 give me a user-friendly name |
248 " |
249 " |
249 (nm := Processor activeProcess name) notNil ifTrue:[ |
250 active := Processor activeProcess. |
|
251 (nm := active name) notNil ifTrue:[ |
250 " |
252 " |
251 avoid name inflation |
253 avoid name inflation |
252 " |
254 " |
253 (nm endsWith:' sub') ifFalse:[ |
255 (nm endsWith:' sub') ifFalse:[ |
254 nm := nm , ' [' , Processor activeProcess id printString , '] sub' |
256 nm := nm , ' [' , active id printString , '] sub' |
255 ]. |
257 ]. |
256 name := nm |
258 name := nm |
257 ] |
259 ] |
258 ! ! |
260 ! ! |
259 |
261 |
550 |
552 |
551 restart |
553 restart |
552 "restart the process from the beginning. |
554 "restart the process from the beginning. |
553 This is sent by the ProcessorScheduler to all restartable processes." |
555 This is sent by the ProcessorScheduler to all restartable processes." |
554 |
556 |
555 ('restart process ' , id printString) errorPrintNL. |
557 "/ ('restart process ' , id printString) errorPrintNL. |
556 (Processor newProcessFor:self) ifFalse:[ |
558 |
|
559 (Processor newProcessFor:self withId:id) ifFalse:[ |
557 "for some reason, the Processor was unable to create |
560 "for some reason, the Processor was unable to create |
558 a VM process for me ...." |
561 a VM process for me ...." |
559 |
562 |
560 ('process ' , id printString , ' failed to restart.') errorPrintNL. |
563 ('process ' , id printString , ' failed to restart.') errorPrintNL. |
561 ^ nil |
564 ^ nil |