PythonQt.QtCore.QMutex · declarations 001
Back to PythonQt.QtCore.QMutex
NonRecursive
instance-attribute
NonRecursive: Any
RecursionMode
instance-attribute
RecursionMode: 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
Recursive
instance-attribute
Recursive: Any
isRecursive
isRecursive() -> bool
X.isRecursive() -> bool
Supplemental documentation: Qt 5 reference:
bool QMutex::isRecursive() const
Returns true if the mutex is recursive.
This function was introduced in Qt 5.7.
Upstream PySide2 reference signatures (binding differences may apply):
isRecursive(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qmutex.html#isRecursive
lock
lock() -> None
X.lock()
Supplemental documentation: Qt 5 reference:
void QMutex::lock()
Locks the mutex. If another thread has locked the mutex then this call will block until that thread has unlocked it.
Calling this function multiple times on the same mutex from the same thread is allowed if this mutex is a recursive mutex. If this mutex is a non-recursive mutex, this function will dead-lock when the mutex is locked recursively.
See also unlock().
Upstream PySide2 reference signatures (binding differences may apply):
lock(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmutex.html#lock
tryLock
tryLock(timeout: Any) -> bool
X.tryLock(timeout) -> bool
Supplemental documentation: Qt 5 reference:
bool QMutex::tryLock(int timeout \= 0)
Attempts to lock the mutex. This function returns true if the lock was obtained;
otherwise it returns false. If another thread has locked the mutex, this function will
wait for at most timeout milliseconds for the mutex to become available.
Note: Passing a negative number as the timeout is equivalent to calling lock(), i.e. this function will wait forever until mutex can be locked if timeout is negative.
If the lock was obtained, the mutex must be unlocked with unlock() before another thread can successfully lock it.
Calling this function multiple times on the same mutex from the same thread is allowed if this mutex is a recursive mutex. If this mutex is a non-recursive mutex, this function will always return false when attempting to lock the mutex recursively.
Upstream PySide2 reference signatures (binding differences may apply):
tryLock(self) -> bool
tryLock(self, timeout: int=...) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qmutex.html#tryLock
unlock
unlock() -> None
X.unlock()
Supplemental documentation: Qt 5 reference:
void QMutex::unlock()
Unlocks the mutex. Attempting to unlock a mutex in a different thread to the one that locked it results in an error. Unlocking a mutex that is not locked results in undefined behavior.
See also lock().
Upstream PySide2 reference signatures (binding differences may apply):
unlock(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qmutex.html#unlock