Qt
6.x
The Qt SDK
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
5
forever
{
6
mutex
.lock();
7
keyPressed.wait(&
mutex
);
8
do_something
();
9
mutex
.unlock();
10
}
12
13
15
forever
{
16
getchar();
17
keyPressed.wakeAll();
18
}
20
21
23
forever
{
24
mutex
.lock();
25
keyPressed.wait(&
mutex
);
26
++
count
;
27
mutex
.unlock();
28
29
do_something
();
30
31
mutex
.lock();
32
--
count
;
33
mutex
.unlock();
34
}
36
37
39
forever
{
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
}
count
GLenum GLenum GLsizei count
Definition
qopengles2ext.h:150
do_something
do_something()
mutex
keyPressed wait & mutex
Definition
src_corelib_thread_qwaitcondition_unix.cpp:7
forever
forever
[0]
Definition
src_corelib_thread_qwaitcondition_unix.cpp:5
count
count
Definition
src_corelib_thread_qwaitcondition_unix.cpp:26
qtbase
src
corelib
doc
snippets
code
src_corelib_thread_qwaitcondition_unix.cpp
Generated by
1.9.7