I just want to make sure I understand something here. If I obtain a lock with Monitor.Enter or lock do I need to call Pulse before releasing the lock?
Monitor.Enter
Monitor.Pulse // Is that neccessary?
Monitor.Exit
I was always led to believe that a Monitor.Exit call would implicitly invoke Monitor.Pulse. Is that actually true?
I'm not exactly sure when would you would use Pulse. That is what is causing confusion.
No, you don't need to call Pulse... but it won't be done automatically when you exit, either.
Pulse and PulseAll are used in conjunction with Wait for signalling purposes.
See the second half of this page for more details (ignore the deadlocking bit, basically :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With