Quantcast
Channel: C#: Using lock will block later calls. - Stack Overflow
Browsing index pages (3 articles)
↧

C#: Using lock will block later calls.

Using lock, i know if there are subsequent call, the later call will be waiting until previous call finishes. What if I don't want to have subsequent call to wait and let it skip that block of code.I...

View Article


Answer by InBetween for C#: Using lock will block later calls.

You can use the Monitor class:keyboardTimer = new Timer(500);keyboardTimer.Elapsed += (sender, e) =>{ if (Monitor.TryEnter(RemoteControlPage.keyboardLock)) { try { var keyboardStatus =...

View Article


Answer by spender for C#: Using lock will block later calls.

All this synchronization biz is a pain to get right. If you don't want to re-enter in a very unambiguous, easily understandable way, just go for an asynchronous loop:async Task...

View Article
Browsing index pages (3 articles)


Latest Images