LibUsbDotNet 2.2.8
LockEventWaiters Method (sessionHandle)
Library Reference ► MonoLibUsb ► MonoUsbApi ► LockEventWaiters(MonoUsbSessionHandle)
|
Acquire the event waiters lock.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public static void LockEventWaiters( MonoUsbSessionHandle sessionHandle )
Public Shared Sub LockEventWaiters ( _ sessionHandle As MonoUsbSessionHandle _ )
public: static void LockEventWaiters( [InAttribute] MonoUsbSessionHandle^ sessionHandle )
Parameters
- sessionHandle (MonoUsbSessionHandle)
- A valid MonoUsbSessionHandle.
Remarks
This lock is designed to be obtained under the situation where you want to be aware when events are completed, but some other thread is event handling so calling libusb_handle_events is not allowed.
You then obtain this lock, re-check that another thread is still handling events, then call libusb_wait_for_event.
You only need to use this lock if you are developing an application which calls poll() or select() on libusb's file descriptors directly, and may potentially be handling events from 2 threads simultaenously. If you stick to libusb's event handling loop functions (e.g. libusb_handle_events) then you do not need to be concerned with this locking.
Note:
Member documentation was originally generated using the Libusb-1.0 API documentation:
Polling and timing