Closed hsvandrew closed 4 years ago
Which wait function and under what condition, specifically? Result is set to False in the Timeout sub-function.
TryEnterWriteLock/TryEnterReadLock should return FALSE if the lock could not be gained. Look through the code. I can't see how its possible for TryEnterWriteLock to ever return false.
The result being set in the timeout function is for the inner Timeout function, not the outer TryLock function. It looks like returnFalse should be setting the outer result to false, but it doesn't....
This code fragment writes out FALSE.
var
rw: TOmniMREW;
rw.EnterReadLock;
Writeln(rw.TryEnterWriteLock(100));
If you don't understand why, walk through the implementation in the debugger.
Sorry to be confused, so line 1296 sets result = true; Which line sets result = false?
This code fragment writes out FALSE.
var rw: TOmniMREW; rw.EnterReadLock; Writeln(rw.TryEnterWriteLock(100));
If you don't understand why, walk through the implementation in the debugger.
I agree this should return false, but in 3.07.7 it returns TRUE on 10.3.3
Sorry! Didn't see this was fixed in .8 release
Are you sure the return value from this code is correct? I might be going crazy but I feel returnFalse should be set to "false" if result = true on the Timeout function and that this function never returns the correct return value of false...