Process.st
author claus
Wed, 13 Oct 1993 01:19:00 +0100
changeset 3 24d81bf47225
parent 1 a27a279701f8
child 5 67342904af11
permissions -rw-r--r--
*** empty log message ***

"
 COPYRIGHT (c) 1992-93 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

Link subclass:#Process
         instanceVariableNames:'id prio state startBlock'
         classVariableNames:''
         poolDictionaries:''
         category:'Kernel-Processes'
!

Process comment:'

COPYRIGHT (c) 1992-93 by Claus Gittinger
             All Rights Reserved

$Header: /cvs/stx/stx/libbasic/Process.st,v 1.3 1993-10-13 00:17:06 claus Exp $
'!

!Process methodsFor:'accessing'!

state
    ^ state
!

state:aSymbol
    state := aSymbol
!

startBlock:aBlock
    startBlock := aBlock
!

priority
    "return the receivers priority"

    ^ prio
!

priority:aNumber
    "set my priority"

    Processor changePriority:aNumber for:self
!

setPriority:aNumber
    "set priority without telling processor - no public use"

    prio := aNumber
!

id
    ^ id
!

id:aNumber
    id := aNumber
!

suspendedContext
%{
    extern OBJ __threadContext();

    RETURN (__threadContext(_intVal(_INST(id))));
%}
! !

!Process methodsFor:'suspend / resume'!

suspend
    Processor suspend:self
!

resume
    Processor resume:self
!

terminate
    Processor terminate:self
! !

!Process methodsFor:'printing'!

printString
    ^ 'a Process with id:' , id printString
! !