By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

threading WaitOne()

P: n/a
I have this kind of construct:

Somewhere in thread 1 -------------------------------------------------

SyncLock _objTxRxSync
'code to set some values in _objTxRxSync object
If _objSignal.WaitOne(1000, True) Then
'do stuff when other thread signals
'do stuff when timeout
End If
End SyncLock

Somewhere in thread 2 -------------------------------------------------

SyncLock _objTxRxSync
'code to set some values in _objTxRxSync object

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?

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.