The following thread synchronization tool is required:
- Can be created in any thread.
- When the
waitmethod was called, it would suspend the current thread if thetakemethod was called in any thread earlier. - If you call the
waitmethod, you would not do anything if thereleasemethod was previously called on any thread. - A
takeandreleasecall counter is not required.
The Qt documentation saw the following thread synchronization tools: QMutex , QSemaphore , QWaitCondition . Unsuitable. In QWaitCondition every time you need to call the wake method, otherwise when you call wait program will continue execution only once, but it is necessary that the thread continue execution until the method that is not there is called ...
waitmethod is called. - maestro