Struct qt_core::q_system_semaphore::AccessMode
source · pub struct AccessMode(/* private fields */);
Expand description
This enum is used by the constructor and setKey(). Its purpose is to enable handling the problem in Unix implementations of semaphores that survive a crash. In Unix, when a semaphore survives a crash, we need a way to force it to reset its resource count, when the system reuses the semaphore. In Windows, where semaphores can't survive a crash, this enum has no effect.
C++ enum: QSystemSemaphore::AccessMode
.
This enum is used by the constructor and setKey(). Its purpose is to enable handling the problem in Unix implementations of semaphores that survive a crash. In Unix, when a semaphore survives a crash, we need a way to force it to reset its resource count, when the system reuses the semaphore. In Windows, where semaphores can’t survive a crash, this enum has no effect.
Implementations§
source§impl AccessMode
impl AccessMode
sourcepub const Open: AccessMode = _
pub const Open: AccessMode = _
If the semaphore already exists, its initial resource count is not reset. If the semaphore does not already exist, it is created and its initial resource count set. (C++ enum variant: Open = 0
)
sourcepub const Create: AccessMode = _
pub const Create: AccessMode = _
QSystemSemaphore takes ownership of the semaphore and sets its resource count to the requested value, regardless of whether the semaphore already exists by having survived a crash. This value should be passed to the constructor, when the first semaphore for a particular key is constructed and you know that if the semaphore already exists it could only be because of a crash. In Windows, where a semaphore can’t survive a crash, Create and Open have the same behavior. (C++ enum variant: Create = 1
)
Trait Implementations§
source§impl Clone for AccessMode
impl Clone for AccessMode
source§fn clone(&self) -> AccessMode
fn clone(&self) -> AccessMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AccessMode
impl Debug for AccessMode
source§impl From<AccessMode> for c_int
impl From<AccessMode> for c_int
source§fn from(value: AccessMode) -> Self
fn from(value: AccessMode) -> Self
source§impl From<i32> for AccessMode
impl From<i32> for AccessMode
source§impl PartialEq for AccessMode
impl PartialEq for AccessMode
source§fn eq(&self, other: &AccessMode) -> bool
fn eq(&self, other: &AccessMode) -> bool
self
and other
values to be equal, and is used
by ==
.