LibUsbDotNet 2.2.8
LockEvents Method (sessionHandle)
Library Reference ► MonoLibUsb ► MonoUsbApi ► LockEvents(MonoUsbSessionHandle)
|
Acquire the event handling lock, blocking until successful acquisition if it is contended.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public static void LockEvents( MonoUsbSessionHandle sessionHandle )
Public Shared Sub LockEvents ( _ sessionHandle As MonoUsbSessionHandle _ )
public: static void LockEvents( [InAttribute] MonoUsbSessionHandle^ sessionHandle )
Parameters
- sessionHandle (MonoUsbSessionHandle)
- A valid MonoUsbSessionHandle.
Remarks
This lock is used to ensure that only one thread is monitoring libusb event sources at any one time.
You only need to use this lock if you are developing an application which calls poll() or select() on libusb's file descriptors directly. 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.
While holding this lock, you are trusted to actually be handling events. If you are no longer handling events, you must call libusb_unlock_events as soon as possible.
Note:
Member documentation was originally generated using the Libusb-1.0 API documentation:
Polling and timing