Events

An event is an object that differs from a semaphore only slightly. Consider the functions for working with events.

  • CreateEvent Creates an event object. This function accepts the following parameters:

    • First parameterThis has the same meaning as the first parameter of the CreateSemaphore function. Usually, it is set to NULL .

    • Second parameterIf this parameter is not equal to zero, then the event can be reset using the ResetEvent function. Otherwise , the event is reset if any process tries to access it.

    • Third parameterIf this parameter is zero, then the event is initialized as reset; otherwise, the signal about the appropriate situation is sent immediately.

    • Fourth parameterThis is the pointer to the string containing the eventname.

  • Waiting for event is carried out the same way as waiting for the semaphoreusing the WaitForSingleObject function.

  • The openEvent function is similar to the OpenSemaphore function. Therefore, I won't concentrate your attention on it.

  • SetEvent Sends the signal that the event has occurred. The only parameter of this function is the handle to the event object.



The Assembly Programming Master Book
The Assembly Programming Master Book
ISBN: 8170088178
EAN: 2147483647
Year: 2004
Pages: 140
Authors: Vlad Pirogov

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net