I have this kind of construct:
Somewhere in thread 1 -------------------------------------------------
SyncLock _objTxRxSync
'code to set some values in _objTxRxSync object
If _objSignal.Wait One(1000, True) Then
'do stuff when other thread signals
Else
'do stuff when timeout
End If
End SyncLock
Somewhere in thread 2 -------------------------------------------------
SyncLock _objTxRxSync
'code to set some values in _objTxRxSync object
_objSignal.Set( )
End SyncLock
--------------------------------------------------------------------------
The problem is that thread 1 never gives up the lock on _objTxRxSync during
the 1000ms wait for thread 2 to access. The documentation states that if the
second parameter for the WaitOne method is set to True, the waiting threat
(thread 1) should give up the lock of the sync context and reaquire it when
signaled by thread 2. Why does this not work? I am using .NET v2.0 latest
release. Is this a bug?
Thanks
Perry
Somewhere in thread 1 -------------------------------------------------
SyncLock _objTxRxSync
'code to set some values in _objTxRxSync object
If _objSignal.Wait One(1000, True) Then
'do stuff when other thread signals
Else
'do stuff when timeout
End If
End SyncLock
Somewhere in thread 2 -------------------------------------------------
SyncLock _objTxRxSync
'code to set some values in _objTxRxSync object
_objSignal.Set( )
End SyncLock
--------------------------------------------------------------------------
The problem is that thread 1 never gives up the lock on _objTxRxSync during
the 1000ms wait for thread 2 to access. The documentation states that if the
second parameter for the WaitOne method is set to True, the waiting threat
(thread 1) should give up the lock of the sync context and reaquire it when
signaled by thread 2. Why does this not work? I am using .NET v2.0 latest
release. Is this a bug?
Thanks
Perry