Skip to content

Commit 5f4e0cf

Browse files
committed
Increased timings in succeed_with_three_in_tricky_sequence
Signed-off-by: Ted Lyngmo <[email protected]>
1 parent fa8dbea commit 5f4e0cf

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/beman/timed_lock_alg/mutex.test.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,17 @@ TEST(Mutex, succeed_with_three_in_tricky_sequence) {
9797
auto th = JThread([&] {
9898
std::lock(mtxs[0], mtxs[1], mtxs[2]);
9999
std::this_thread::sleep_for(55ms);
100-
mtxs[0].unlock(); // 5ms after try_lock_for started, 35ms left
100+
mtxs[0].unlock(); // 5ms after try_lock_for started, 95ms left
101101
// try_lock_for gets this and jumps to mtxs[1]
102102
std::this_thread::sleep_for(5ms);
103103
mtxs[2].unlock(); // try_lock_for still hangs on mtxs[1]
104104
mtxs[0].lock();
105105
mtxs[1].unlock(); // try_lock_for gets this and jumps to mtxs[0]
106-
// 30ms after try_lock_for started, 10ms left
106+
// 10ms after try_lock_for started, 90ms left
107107
std::this_thread::sleep_for(10ms);
108-
mtxs[0].unlock(); // try_lock_for should have 20ms left here
108+
mtxs[0].unlock(); // try_lock_for should have 80ms left here
109109
});
110110

111111
std::this_thread::sleep_for(50ms);
112-
// 20ms is enough for most implementations, but some require a lot more so let them have it:
113-
EXPECT_EQ(-1, std::apply([](auto&... mts) { return tla::try_lock_for(40ms + extra_grace, mts...); }, mtxs));
112+
EXPECT_EQ(-1, std::apply([](auto&... mts) { return tla::try_lock_for(100ms + extra_grace, mts...); }, mtxs));
114113
}

0 commit comments

Comments
 (0)