Tech Support > Microsoft Windows > Development Resources > .NET Monitor.Wait() or Java Object.wait() in WinAPI
.NET Monitor.Wait() or Java Object.wait() in WinAPI
Posted by Alexander Smirnov on November 13th, 2007


Hello!

How to implement in WinAPI the same functionality as .NET Framework
Monitor.Wait(), Monitor.Pulse() or Java Object.wait(),Object.notify()
methods have?

Thanks in advance.

Posted by Jerry Coffin on November 17th, 2007


In article <1194983115.481587.159220@v2g2000hsf.googlegroups. com>,
s_alexander04@list.ru says...
Doing a quick look through the docs, the mapping is apparently:

Monitor.Wait WaitForSingleObject
Monitor.Pulse SetEvent
Monitor.PulseAll PulseEvent

On the Win32 side, you use CreateEvent to create the event. You can
create it as a manual-reset or an auto-reset event, though it appears
that the Monitor usage is (at least generally) more like an auto-reset
event.

--
Later,
Jerry.

The universe is a figment of its own imagination.