pub type cef_waitable_event_t = _cef_waitable_event_t;Expand description
WaitableEvent is a thread synchronization tool that allows one thread to wait for another thread to finish some work. This is equivalent to using a Lock+ConditionVariable to protect a simple boolean value. However, using WaitableEvent in conjunction with a Lock to wait for a more complex state change (e.g., for an item to be added to a queue) is not recommended. In that case consider using a ConditionVariable instead of a WaitableEvent. It is safe to create and/or signal a WaitableEvent from any thread. Blocking on a WaitableEvent by calling the *wait() functions is not allowed on the browser process UI or IO threads.
NOTE: This struct is allocated DLL-side.
Aliased Type§
#[repr(C)]pub struct cef_waitable_event_t {
pub base: _cef_base_ref_counted_t,
pub reset: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t)>,
pub signal: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t)>,
pub is_signaled: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t) -> i32>,
pub wait: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t)>,
pub timed_wait: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t, i64) -> i32>,
}Fields§
§base: _cef_base_ref_counted_tBase structure.
reset: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t)>Put the event in the un-signaled state.
signal: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t)>Put the event in the signaled state. This causes any thread blocked on Wait to be woken up.
is_signaled: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t) -> i32>Returns true (1) if the event is in the signaled state, else false (0). If the event was created with |automatic_reset| set to true (1) then calling this function will also cause a reset.
wait: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t)>Wait indefinitely for the event to be signaled. This function will not return until after the call to signal() has completed. This function cannot be called on the browser process UI or IO threads.
timed_wait: Option<unsafe extern "C" fn(*mut _cef_waitable_event_t, i64) -> i32>Wait up to |max_ms| milliseconds for the event to be signaled. Returns true (1) if the event was signaled. A return value of false (0) does not necessarily mean that |max_ms| was exceeded. This function will not return until after the call to signal() has completed. This function cannot be called on the browser process UI or IO threads.