Issue 94: fixed a bad bug in #acquireWithTimeoutMs:
Obviously, we MUST check whether we the wait for lock timed
out or not. How comes I did not notice before? Maybe my Linux
machine is so fast it never timed out. Sigh.
--- a/AbstractLock.st Mon Dec 11 11:36:00 2017 +0000
+++ b/AbstractLock.st Mon Dec 11 14:14:42 2017 +0000
@@ -188,8 +188,10 @@
"/ in case the Semaphore >> #wait is prematurely terminated.
"/ Q: Can this actually happen? If so, how?
acquired := sema waitWithTimeoutMs: timeout.
- process := active.
- count := 1.
+ acquired notNil ifTrue:[
+ process := active.
+ count := 1.
+ ].
wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
] ifCurtailed:[
acquired notNil ifTrue:[
@@ -203,6 +205,7 @@
^acquired notNil.
"Created: / 25-08-2017 / 22:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 11-12-2017 / 14:11:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
release