Desktop Functions: Smart Device Functions:
|
Search Results for "SetEvent" in [All]winmm1: timeSetEvent
static extern UInt32 timeSetEvent( UInt32 msDelay, UInt32 msResolution,
Declare Function timeSetEvent Lib "winmm.dll" (TODO) As TODO
static extern uint timeSetEvent(uint uDelay, uint uResolution, TimerCallback lpTimeProc, UIntPtr dwUser, uint fuEvent);
//TIME_CALLBACK_EVENT_SET = 0x0010, /* callback is event - use SetEvent */
id = timeSetEvent(ms, 0, thisCB, UIntPtr.Zero, (uint)f);
throw new Exception("timeSetEvent error"); fbwflibThe API defines an Void-Pointer as a parameter. The pointer must point to a function with 4 parameters itself. The parameters are the same as a WaitHandle with its initial state set to false. So you can use the SafeHandle of the ResetEvent class.
_manualResetEvent = new ManualResetEvent(false);
NativeMethods.FbwfCacheThresholdNotification((uint)100, _manualResetEvent.SafeWaitHandle); advapi32
private ManualResetEvent heartbeatStopped;
private ManualResetEvent heartbeatActive;
private ManualResetEvent terminationPending;
terminationPending = new ManualResetEvent (false);
heartbeatStopped = new ManualResetEvent (true);
heartbeatActive = new ManualResetEvent (false); coredll4: CreateEvent
Public Shared Function SetEvent(ByVal handle As IntPtr) As Integer
Public Shared Function ResetEvent(ByVal handle As IntPtr) As Integer
Sub New(ByVal initialState As Boolean, ByVal name As String, ByVal isManualResetEvent As Boolean)
_handle = WaitHandles.CreateEvent(IntPtr.Zero, isManualResetEvent, initialState, name)
''' <remarks>The state of a manual-reset event object remains signaled until it is set explicitly to the nonsignaled state by the ResetEvent function. Any number of waiting threads, or threads that subsequently begin wait operations for the specified event object by calling one of the wait functions, can be released while the object's state is signaled.
Return WaitHandles.SetEvent(Me._handle)
''' <remarks>ResetEvent returns FALSE if the handle to the event object is invalid.
'''The state of an event object remains nonsignaled until it is explicitly set to signaled by the SetEvent or PulseEvent function. This nonsignaled state blocks the execution of any threads that have specified the event object in a call to one of the wait functions.
'''ResetEvent sets the event to the nonsignaled state even if the event was signaled multiple times before being signaled. The ResetEvent function is used primarily for manual signal event objects, which must be set explicitly to the nonsignaled state. Auto-signal event objects automatically change from signaled to nonsignaled after a single waiting thread is released.
Return WaitHandles.ResetEvent(Me._handle)
''' Wraps a custom type of AutoResetEvent
''' Wraps a custom type of ManualResetEvent
''' Initialise a new ManualResetEvent 5: EventModify
private static bool SetEvent(HANDLE hEvent)
private static bool ResetEvent(HANDLE hEvent)
SetEvent(p);
ResetEvent(p); 6: ResetEvent
private static bool ResetEvent(HANDLE hEvent)
Declare Function ResetEvent Lib "coredll.dll" (TODO) As TODO
private static bool SetEvent(HANDLE hEvent)
private static bool ResetEvent(HANDLE hEvent)
SetEvent(p);
ResetEvent(p); 7: SetEvent
private static bool SetEvent(HANDLE hEvent)
private static bool SetEvent(HANDLE hEvent)
private static bool ResetEvent(HANDLE hEvent)
SetEvent(p);
ResetEvent(p); kernel328: CreateEvent Tip 1: Use CreateEvent to create named event and attach it to AutoResetEvent class:
AutoResetEvent are= new AutoResetEvent(false);
static extern bool SetEvent(IntPtr hEvent);
static extern bool ResetEvent(IntPtr hEvent);
SetEvent( _Handle );
ResetEvent( _Handle ); [timeSetEvent] [timeSetEvent] 11: DeviceIoControl
public void ClearAndSetEvent(IntPtr hEventOverlapped)
ManualResetEvent hEvent = new ManualResetEvent(false);
deviceIoOverlapped.ClearAndSetEvent(hEvent.SafeWaitHandle.DangerousGetHandle()); 12: OpenEvent Tip 1: Use OpenEvent to open named event and attach it to AutoResetEvent class:
AutoResetEvent are= new AutoResetEvent(false); 13: SetEvent
static extern bool SetEvent(IntPtr hEvent); Private Shared Function SetEvent(hEvent As IntPtr) As Boolean System.Threading.WaitHandle and derivatives (e.g. AutoResetEvent) ole32
System.Threading.ManualResetEvent event = new System.Threading.ManualResetEvent(false); |