The QMutex class, part of the Qt framework, provides access serialization between threads.
The purpose of a QMutex
is to protect an object, data structure or section of code so that only one thread can access it at a time (this is similar to the Java synchronized
keyword). It is usually best to use a mutex with a QMutexLocker
The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.