File tree Expand file tree Collapse file tree 10 files changed +43
-43
lines changed
libcxx/test/std/thread/thread.condition
thread.condition.condvarany Expand file tree Collapse file tree 10 files changed +43
-43
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ int main(int, char**) {
4343 // happen that we get awoken spuriously and fail to recognize it
4444 // (making this test useless), but the likelihood should be small.
4545 {
46- std::atomic<bool > ready = false ;
47- std::atomic<bool > likely_spurious = true ;
46+ std::atomic<bool > ready ( false ) ;
47+ std::atomic<bool > likely_spurious ( true ) ;
4848 auto timeout = std::chrono::seconds (3600 );
4949 std::condition_variable cv;
5050 std::mutex mutex;
Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ int main(int, char**) {
4343 // the likelihood that we got awoken by a spurious wakeup by updating the
4444 // likely_spurious flag only immediately before we perform the notification.
4545 {
46- std::atomic<bool > ready = false ;
47- std::atomic<bool > likely_spurious = true ;
48- auto timeout = std::chrono::seconds (3600 );
46+ std::atomic<bool > ready ( false ) ;
47+ std::atomic<bool > likely_spurious ( true ) ;
48+ auto timeout = std::chrono::seconds (3600 );
4949 std::condition_variable cv;
5050 std::mutex mutex;
5151
@@ -110,9 +110,9 @@ int main(int, char**) {
110110 // taken. In particular, we do need to eventually ensure we get out of the wait
111111 // by standard means, so we actually wake up the thread at the end.
112112 {
113- std::atomic<bool > ready = false ;
114- std::atomic<bool > awoken = false ;
115- auto timeout = std::chrono::seconds (3600 );
113+ std::atomic<bool > ready ( false ) ;
114+ std::atomic<bool > awoken ( false ) ;
115+ auto timeout = std::chrono::seconds (3600 );
116116 std::condition_variable cv;
117117 std::mutex mutex;
118118
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ int main(int, char**) {
3131 // spurious wakeup by updating the likely_spurious flag only immediately
3232 // before we perform the notification.
3333 {
34- std::atomic<bool > ready = false ;
35- std::atomic<bool > likely_spurious = true ;
34+ std::atomic<bool > ready ( false ) ;
35+ std::atomic<bool > likely_spurious ( true ) ;
3636 std::condition_variable cv;
3737 std::mutex mutex;
3838
@@ -70,8 +70,8 @@ int main(int, char**) {
7070 // taken. In particular, we do need to eventually ensure we get out of the wait
7171 // by standard means, so we actually wake up the thread at the end.
7272 {
73- std::atomic<bool > ready = false ;
74- std::atomic<bool > awoken = false ;
73+ std::atomic<bool > ready ( false ) ;
74+ std::atomic<bool > awoken ( false ) ;
7575 std::condition_variable cv;
7676 std::mutex mutex;
7777
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ void test() {
4949 // happen that we get awoken spuriously and fail to recognize it
5050 // (making this test useless), but the likelihood should be small.
5151 {
52- std::atomic<bool > ready = false ;
53- std::atomic<bool > likely_spurious = true ;
54- auto timeout = Clock::now () + std::chrono::seconds (3600 );
52+ std::atomic<bool > ready ( false ) ;
53+ std::atomic<bool > likely_spurious ( true ) ;
54+ auto timeout = Clock::now () + std::chrono::seconds (3600 );
5555 std::condition_variable cv;
5656 std::mutex mutex;
5757
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ void test() {
4949 // the likelihood that we got awoken by a spurious wakeup by updating the
5050 // likely_spurious flag only immediately before we perform the notification.
5151 {
52- std::atomic<bool > ready = false ;
53- std::atomic<bool > likely_spurious = true ;
54- auto timeout = Clock::now () + std::chrono::seconds (3600 );
52+ std::atomic<bool > ready ( false ) ;
53+ std::atomic<bool > likely_spurious ( true ) ;
54+ auto timeout = Clock::now () + std::chrono::seconds (3600 );
5555 std::condition_variable cv;
5656 std::mutex mutex;
5757
@@ -112,9 +112,9 @@ void test() {
112112 // taken. In particular, we do need to eventually ensure we get out of the wait
113113 // by standard means, so we actually wake up the thread at the end.
114114 {
115- std::atomic<bool > ready = false ;
116- std::atomic<bool > awoken = false ;
117- auto timeout = Clock::now () + std::chrono::seconds (3600 );
115+ std::atomic<bool > ready ( false ) ;
116+ std::atomic<bool > awoken ( false ) ;
117+ auto timeout = Clock::now () + std::chrono::seconds (3600 );
118118 std::condition_variable cv;
119119 std::mutex mutex;
120120
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ void test() {
4949 // happen that we get awoken spuriously and fail to recognize it
5050 // (making this test useless), but the likelihood should be small.
5151 {
52- std::atomic<bool > ready = false ;
53- std::atomic<bool > likely_spurious = true ;
54- auto timeout = std::chrono::seconds (3600 );
52+ std::atomic<bool > ready ( false ) ;
53+ std::atomic<bool > likely_spurious ( true ) ;
54+ auto timeout = std::chrono::seconds (3600 );
5555 std::condition_variable_any cv;
5656 Mutex mutex;
5757
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ void test() {
4949 // the likelihood that we got awoken by a spurious wakeup by updating the
5050 // likely_spurious flag only immediately before we perform the notification.
5151 {
52- std::atomic<bool > ready = false ;
53- std::atomic<bool > likely_spurious = true ;
54- auto timeout = std::chrono::seconds (3600 );
52+ std::atomic<bool > ready ( false ) ;
53+ std::atomic<bool > likely_spurious ( true ) ;
54+ auto timeout = std::chrono::seconds (3600 );
5555 std::condition_variable_any cv;
5656 Mutex mutex;
5757
@@ -116,9 +116,9 @@ void test() {
116116 // taken. In particular, we do need to eventually ensure we get out of the wait
117117 // by standard means, so we actually wake up the thread at the end.
118118 {
119- std::atomic<bool > ready = false ;
120- std::atomic<bool > awoken = false ;
121- auto timeout = std::chrono::seconds (3600 );
119+ std::atomic<bool > ready ( false ) ;
120+ std::atomic<bool > awoken ( false ) ;
121+ auto timeout = std::chrono::seconds (3600 );
122122 std::condition_variable_any cv;
123123 Mutex mutex;
124124
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ void test() {
3939 // spurious wakeup by updating the likely_spurious flag only immediately
4040 // before we perform the notification.
4141 {
42- std::atomic<bool > ready = false ;
43- std::atomic<bool > likely_spurious = true ;
42+ std::atomic<bool > ready ( false ) ;
43+ std::atomic<bool > likely_spurious ( true ) ;
4444 std::condition_variable_any cv;
4545 Mutex mutex;
4646
@@ -78,8 +78,8 @@ void test() {
7878 // taken. In particular, we do need to eventually ensure we get out of the wait
7979 // by standard means, so we actually wake up the thread at the end.
8080 {
81- std::atomic<bool > ready = false ;
82- std::atomic<bool > awoken = false ;
81+ std::atomic<bool > ready ( false ) ;
82+ std::atomic<bool > awoken ( false ) ;
8383 std::condition_variable_any cv;
8484 Mutex mutex;
8585
Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ void test() {
5454 // happen that we get awoken spuriously and fail to recognize it
5555 // (making this test useless), but the likelihood should be small.
5656 {
57- std::atomic<bool > ready = false ;
58- std::atomic<bool > likely_spurious = true ;
59- auto timeout = Clock::now () + std::chrono::seconds (3600 );
57+ std::atomic<bool > ready ( false ) ;
58+ std::atomic<bool > likely_spurious ( true ) ;
59+ auto timeout = Clock::now () + std::chrono::seconds (3600 );
6060 std::condition_variable_any cv;
6161 Mutex mutex;
6262
Original file line number Diff line number Diff line change @@ -55,9 +55,9 @@ void test() {
5555 // the likelihood that we got awoken by a spurious wakeup by updating the
5656 // likely_spurious flag only immediately before we perform the notification.
5757 {
58- std::atomic<bool > ready = false ;
59- std::atomic<bool > likely_spurious = true ;
60- auto timeout = Clock::now () + std::chrono::seconds (3600 );
58+ std::atomic<bool > ready ( false ) ;
59+ std::atomic<bool > likely_spurious ( true ) ;
60+ auto timeout = Clock::now () + std::chrono::seconds (3600 );
6161 std::condition_variable_any cv;
6262 Mutex mutex;
6363
@@ -118,9 +118,9 @@ void test() {
118118 // taken. In particular, we do need to eventually ensure we get out of the wait
119119 // by standard means, so we actually wake up the thread at the end.
120120 {
121- std::atomic<bool > ready = false ;
122- std::atomic<bool > awoken = false ;
123- auto timeout = Clock::now () + std::chrono::seconds (3600 );
121+ std::atomic<bool > ready ( false ) ;
122+ std::atomic<bool > awoken ( false ) ;
123+ auto timeout = Clock::now () + std::chrono::seconds (3600 );
124124 std::condition_variable_any cv;
125125 Mutex mutex;
126126
You can’t perform that action at this time.
0 commit comments