Obsolete Members for QMutex

The following members of class QMutex are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Types

(obsolete) enum RecursionMode { Recursive, NonRecursive }

Public Functions

(obsolete) QMutex(RecursionMode mode)

Member Type Documentation

enum QMutex::RecursionMode

This enum is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use QRecursiveMutex to create a recursive mutex.

ConstantValueDescription
QMutex::Recursive1In this mode, a thread can lock the same mutex multiple times and the mutex won't be unlocked until a corresponding number of unlock() calls have been made. You should use QRecursiveMutex for this use-case.
QMutex::NonRecursive0In this mode, a thread may only lock a mutex once.

See also QMutex() and QRecursiveMutex.

Member Function Documentation

QMutex::QMutex(RecursionMode mode)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Constructs a new mutex. The mutex is created in an unlocked state. Use QRecursiveMutex to create a recursive mutex.

If mode is QMutex::Recursive, a thread can lock the same mutex multiple times and the mutex won't be unlocked until a corresponding number of unlock() calls have been made. Otherwise a thread may only lock a mutex once. The default is QMutex::NonRecursive.

Recursive mutexes are slower and take more memory than non-recursive ones.

See also lock() and unlock().