Process.st
changeset 1 a27a279701f8
child 3 24d81bf47225
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Process.st	Fri Jul 16 11:39:45 1993 +0200
@@ -0,0 +1,94 @@
+"
+ 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
+
+%W% %E%
+'!
+
+!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
+! !