Commit 7730316 1 parent c7bc75d commit 7730316 Copy full SHA for 7730316
File tree 2 files changed +4
-4
lines changed
tests/park_section_no_miss
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ endif()
47
47
48
48
enable_testing ()
49
49
50
- option (THREAD_PARK_RUN_TESTS "Run tests" ON )
50
+ option (THREAD_PARK_RUN_TESTS "Run tests" OFF )
51
51
if (THREAD_PARK_RUN_TESTS)
52
52
add_subdirectory (tests)
53
53
endif ()
Original file line number Diff line number Diff line change 8
8
9
9
static constexpr int NUM_ITERATIONS = 100 ;
10
10
11
- static constexpr auto MAX_WAIT_MS = 500 ; // 0.5 seconds
11
+ static constexpr auto MAX_WAIT_MS = 500 ;
12
12
13
13
int main () {
14
14
tpark_handle_t *handle = tparkCreateHandle ();
@@ -19,7 +19,7 @@ int main() {
19
19
for (int i = 0 ; i < NUM_ITERATIONS && !stop.load (); i++) {
20
20
// Sleep a *tiny* bit so consumer definitely has set "state=1"
21
21
// but maybe hasn't called tparkParkWait yet.
22
- std::this_thread::sleep_for (std::chrono::milliseconds (10 ));
22
+ std::this_thread::sleep_for (std::chrono::milliseconds (100 ));
23
23
24
24
// Attempt to wake — if consumer hasn't actually parked yet,
25
25
// we want to verify we do *not* lose this wake.
@@ -36,7 +36,7 @@ int main() {
36
36
37
37
// 2) Simulate some short pause before actually calling parkWait
38
38
// The producer may call tparkWake() in this window.
39
- std::this_thread::sleep_for (std::chrono::milliseconds (5 ));
39
+ std::this_thread::sleep_for (std::chrono::milliseconds (50 ));
40
40
41
41
// 3) Actually park. But if the wake arrived "too early",
42
42
// the state is already zero and we won't block.
You can’t perform that action at this time.
0 commit comments