PythonQt.QtCore.QSystemSemaphore · declarations 001
Back to PythonQt.QtCore.QSystemSemaphore
Open
instance-attribute
Open: Any
SystemSemaphoreError
instance-attribute
SystemSemaphoreError: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
acquire
acquire() -> bool
X.acquire() -> bool
Supplemental documentation: Qt 5 reference:
bool QSystemSemaphore::acquire()
Acquires one of the resources guarded by this semaphore, if there is one available, and
returns true. If all the resources guarded by this semaphore have already been
acquired, the call blocks until one of them is released by another process or thread
having a semaphore with the same key.
If false is returned, a system error has occurred. Call error() to get a value of QSystemSemaphore::SystemSemaphoreError that indicates which error occurred.
See also release().
Upstream PySide2 reference signatures (binding differences may apply):
acquire(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qsystemsemaphore.html#acquire
error
error() -> Any
X.error()
Supplemental documentation: Qt 5 reference:
QSystemSemaphore::SystemSemaphoreError QSystemSemaphore::error() const
Returns a value indicating whether an error occurred, and, if so, which error it was.
See also errorString().
Upstream PySide2 reference signatures (binding differences may apply):
error(self) -> PySide2.QtCore.QSystemSemaphore.SystemSemaphoreError
Source: https://doc.qt.io/archives/qt-5.15/qsystemsemaphore.html#error
errorString
errorString() -> str
X.errorString() -> str
Supplemental documentation: Qt 5 reference:
QString QSystemSemaphore::errorString() const
Returns a text description of the last error that occurred. If error() returns an error value, call this function to get a text string that describes the error.
See also error().
Upstream PySide2 reference signatures (binding differences may apply):
errorString(self) -> str
Source: https://doc.qt.io/archives/qt-5.15/qsystemsemaphore.html#errorString
key
key() -> str
X.key() -> str
Supplemental documentation: Qt 5 reference:
QString QSystemSemaphore::key() const
Returns the key assigned to this system semaphore. The key is the name by which the semaphore can be accessed from other processes.
See also setKey().
Upstream PySide2 reference signatures (binding differences may apply):
key(self) -> str
Source: https://doc.qt.io/archives/qt-5.15/qsystemsemaphore.html#key
release
release(n: int) -> bool
X.release(n) -> bool
Supplemental documentation: Qt 5 reference:
bool QSystemSemaphore::release(int n \= 1)
Releases n resources guarded by the semaphore. Returns true unless there is a system
error.
Example: Create a system semaphore having five resources; acquire them all and then release them all.
QSystemSemaphore sem("market", 5, QSystemSemaphore::Create);
for (int i = 0; i < 5; ++i) // acquire all 5 resources
sem.acquire();
sem.release(5); // release the 5 resources
This function can also "create" resources. For example, immediately following the sequence of statements above, suppose we add the statement:
sem.release(10); // "create" 10 new resources
Ten new resources are now guarded by the semaphore, in addition to the five that already existed. You would not normally use this function to create more resources.
See also acquire().
Upstream PySide2 reference signatures (binding differences may apply):
release(self, n: int=...) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qsystemsemaphore.html#release
setKey
setKey(key: str, initialValue: int, mode: Any) -> None
X.setKey(key, initialValue, mode)
Supplemental documentation: Qt 5 reference:
void QSystemSemaphore::setKey(const QString \&key, int initialValue \= 0, QSystemSemaphore::AccessMode mode \= Open)
This function works the same as the constructor. It reconstructs this QSystemSemaphore object. If the new key is different from the old key, calling this function is like calling the destructor of the semaphore with the old key, then calling the constructor to create a new semaphore with the new key. The initialValue and mode parameters are as defined for the constructor.
See also QSystemSemaphore() and key().
Upstream PySide2 reference signatures (binding differences may apply):
setKey(self, key: str, initialValue: int=..., mode: PySide2.QtCore.QSystemSemaphore.AccessMode=...) -> None
Source: https://doc.qt.io/archives/qt-5.15/qsystemsemaphore.html#setKey