Use lockChannelOut to avoid races when locking/unlocking
authorStefan Vogel <sv@exept.de>
Mon, 02 Oct 2000 16:07:15 +0200
changeset 1415 fd8738cc4733
parent 1414 5a0a92020197
child 1416 79f3aee2d64c
Use lockChannelOut to avoid races when locking/unlocking
ScreenLock.st
--- a/ScreenLock.st	Fri Sep 29 12:18:07 2000 +0200
+++ b/ScreenLock.st	Mon Oct 02 16:07:15 2000 +0200
@@ -2,7 +2,7 @@
 
 EventListener subclass:#ScreenLock
 	instanceVariableNames:'workstation lastInactiveTime lockAfterSeconds lockChannel
-		lockedViews hiddenViews'
+		lockChannelOut lockedViews hiddenViews'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-Support'
@@ -106,6 +106,16 @@
     lockChannel addDependent:self.
 !
 
+lockChannelOut
+    "return the value of the instance variable 'lockChannelOut' (automatically generated)"
+
+    ^ lockChannelOut!
+
+lockChannelOut:something
+    "set the value of the instance variable 'lockChannelOut' (automatically generated)"
+
+    lockChannelOut := something.!
+
 workstation
     "return the value of the instance variable 'workstation' (automatically generated)"
 
@@ -248,6 +258,10 @@
         v beInvisible.
     ].
 
+    lockChannelOut notNil ifTrue:[      
+        lockChannelOut value:true.
+    ].
+
 !
 
 unlockScreen
@@ -257,6 +271,11 @@
         v beVisible.
     ].
     hiddenViews := lockedViews := nil.
+
+    lockChannelOut notNil ifTrue:[      
+        lockChannelOut value:false.
+    ].
+
 ! !
 
 !ScreenLock methodsFor:'queries'!
@@ -269,5 +288,5 @@
 !ScreenLock class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ScreenLock.st,v 1.3 2000-05-24 10:50:41 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ScreenLock.st,v 1.4 2000-10-02 14:07:15 stefan Exp $'
 ! !