Process.st
changeset 339 e8658d38abfb
parent 337 7c6b8d4e6a5b
child 345 cf2301210c47
equal deleted inserted replaced
338:20376737bdaf 339:e8658d38abfb
    22 
    22 
    23 Process comment:'
    23 Process comment:'
    24 COPYRIGHT (c) 1992 by Claus Gittinger
    24 COPYRIGHT (c) 1992 by Claus Gittinger
    25 	     All Rights Reserved
    25 	     All Rights Reserved
    26 
    26 
    27 $Header: /cvs/stx/stx/libbasic/Process.st,v 1.25 1995-05-04 12:48:11 claus Exp $
    27 $Header: /cvs/stx/stx/libbasic/Process.st,v 1.26 1995-05-08 03:30:40 claus Exp $
    28 '!
    28 '!
    29 
    29 
    30 !Process class methodsFor:'documentation'!
    30 !Process class methodsFor:'documentation'!
    31 
    31 
    32 copyright
    32 copyright
    43 "
    43 "
    44 !
    44 !
    45 
    45 
    46 version
    46 version
    47 "
    47 "
    48 $Header: /cvs/stx/stx/libbasic/Process.st,v 1.25 1995-05-04 12:48:11 claus Exp $
    48 $Header: /cvs/stx/stx/libbasic/Process.st,v 1.26 1995-05-08 03:30:40 claus Exp $
    49 "
    49 "
    50 !
    50 !
    51 
    51 
    52 documentation
    52 documentation
    53 "
    53 "
   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