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 more