give mutual-exclusion semas a distinct default name
authorClaus Gittinger <cg@exept.de>
Wed, 17 Jun 1998 16:23:27 +0200
changeset 3600 6c5629eea51d
parent 3599 fea09a812f55
child 3601 c879b9a15f38
give mutual-exclusion semas a distinct default name
Semaphore.st
--- a/Semaphore.st	Wed Jun 17 12:52:09 1998 +0200
+++ b/Semaphore.st	Wed Jun 17 16:23:27 1998 +0200
@@ -149,9 +149,9 @@
      wait on it without blocking. This type of semaphore is used
      for mutual exclusion from critical regions (see #critical:)"
 
-    ^ super new setCount:1
+    ^ super new setCount:1; name:'criticalRegionSema'
 
-    "Modified: 10.1.1997 / 21:44:30 / cg"
+    "Modified: / 17.6.1998 / 16:23:09 / cg"
 !
 
 new
@@ -456,11 +456,11 @@
      things will go mad ... (especially be careful when adding a debugPrint-here)
     "
     count ~~ 0 ifTrue:[
-	count := count - 1.
-	count == 0 ifTrue:[
-	    lastOwnerID := Processor activeProcessId.
-	].
-	^ self
+        count := count - 1.
+        count == 0 ifTrue:[
+            lastOwnerID := Processor activeProcessId.
+        ].
+        ^ self
     ].
 
     activeProcess := Processor activeProcess.
@@ -473,32 +473,32 @@
      suspend.
     "
     [count == 0] whileTrue:[
-	waitingProcesses add:activeProcess.
-	"
-	 for some more descriptive info in processMonitor ...
-	 ... set the state to #wait (instead of #suspend)
-	"
-	[
-	    activeProcess suspendWithState:#wait
-	] valueOnUnwindDo:[
-	    waitingProcesses removeIdentical:activeProcess ifAbsent:[].
-	    wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
-	].
+        waitingProcesses add:activeProcess.
+        "
+         for some more descriptive info in processMonitor ...
+         ... set the state to #wait (instead of #suspend)
+        "
+        [
+            activeProcess suspendWithState:#wait
+        ] valueOnUnwindDo:[
+            waitingProcesses removeIdentical:activeProcess ifAbsent:[].
+            wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+        ].
         
-	count == 0 ifTrue:[
-	    "/ care for someone manually resuming me ...
-	    "/ being multiple times on waitingProcesses
-	    waitingProcesses removeIdentical:activeProcess ifAbsent:[].
-	]
+        count == 0 ifTrue:[
+            "/ care for someone manually resuming me ...
+            "/ being multiple times on waitingProcesses
+            waitingProcesses removeIdentical:activeProcess ifAbsent:[].
+        ]
     ].
     count := count - 1.
     count == 0 ifTrue:[
-	lastOwnerID := Processor activeProcessId.
+        lastOwnerID := Processor activeProcessId.
     ].
     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
 
-    "Modified: 13.12.1995 / 13:26:33 / stefan"
-    "Modified: 1.2.1997 / 12:11:32 / cg"
+    "Modified: / 13.12.1995 / 13:26:33 / stefan"
+    "Modified: / 17.6.1998 / 15:26:27 / cg"
 !
 
 waitUncounted
@@ -643,5 +643,5 @@
 !Semaphore class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.49 1998-04-22 18:31:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.50 1998-06-17 14:23:27 cg Exp $'
 ! !