@@ -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