Randall Flagg
Randall Flagg

Reputation: 5108

Is there a cross platform .NET equivalent to Win32.SetEvent(int)?

Is there a cross platform .NET equivalent to Win32 SetEvent(int)?

[DllImport("kernel32.dll")]
public static extern bool SetEvent(IntPtr hEvent);

Upvotes: 1

Views: 1278

Answers (2)

nvoigt
nvoigt

Reputation: 77304

It's hard to answer this question without any context. The class ManualResetEvent (Microsoft/Mono) should be present in .NET and Mono. It should handle all your basic needs with event signalling.

There are a lot of more sophisticated classes in System.Threading that may be of help.

Upvotes: 1

Rotem
Rotem

Reputation: 21927

Yes, use a ManualResetEvent, and use the Set and Reset methods to control its signaled state.

Upvotes: 0

Related Questions