Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_corelib_thread_qwaitcondition_unix.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
6 mutex.lock();
7 keyPressed.wait(&mutex);
9 mutex.unlock();
10}
12
13
15forever {
16 getchar();
17 keyPressed.wakeAll();
18}
20
21
23forever {
24 mutex.lock();
25 keyPressed.wait(&mutex);
27 mutex.unlock();
28
30
31 mutex.lock();
32 --count;
33 mutex.unlock();
34}
36
37
39forever {
40 getchar();
41
42 mutex.lock();
43 // Sleep until there are no busy worker threads
44 while (count > 0) {
45 mutex.unlock();
46 sleep(1);
47 mutex.lock();
48 }
49 keyPressed.wakeAll();
50 mutex.unlock();
51}
GLenum GLenum GLsizei count
do_something()
keyPressed wait & mutex