|
|
@ -46,7 +46,7 @@ struct FakeCheckCheckCompletion { |
|
|
|
|
|
|
|
|
|
|
|
struct FailingCheck { |
|
|
|
struct FailingCheck { |
|
|
|
bool fails; |
|
|
|
bool fails; |
|
|
|
FailingCheck(bool fails) : fails(fails){}; |
|
|
|
FailingCheck(bool _fails) : fails(_fails){}; |
|
|
|
FailingCheck() : fails(true){}; |
|
|
|
FailingCheck() : fails(true){}; |
|
|
|
bool operator()() |
|
|
|
bool operator()() |
|
|
|
{ |
|
|
|
{ |
|
|
@ -411,15 +411,15 @@ BOOST_AUTO_TEST_CASE(test_CheckQueueControl_Locks) |
|
|
|
std::unique_lock<std::mutex> l(m); |
|
|
|
std::unique_lock<std::mutex> l(m); |
|
|
|
tg.create_thread([&]{ |
|
|
|
tg.create_thread([&]{ |
|
|
|
CCheckQueueControl<FakeCheck> control(queue.get()); |
|
|
|
CCheckQueueControl<FakeCheck> control(queue.get()); |
|
|
|
std::unique_lock<std::mutex> l(m); |
|
|
|
std::unique_lock<std::mutex> ll(m); |
|
|
|
has_lock = true; |
|
|
|
has_lock = true; |
|
|
|
cv.notify_one(); |
|
|
|
cv.notify_one(); |
|
|
|
cv.wait(l, [&]{return has_tried;}); |
|
|
|
cv.wait(ll, [&]{return has_tried;}); |
|
|
|
done = true; |
|
|
|
done = true; |
|
|
|
cv.notify_one(); |
|
|
|
cv.notify_one(); |
|
|
|
// Wait until the done is acknowledged
|
|
|
|
// Wait until the done is acknowledged
|
|
|
|
//
|
|
|
|
//
|
|
|
|
cv.wait(l, [&]{return done_ack;}); |
|
|
|
cv.wait(ll, [&]{return done_ack;}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
// Wait for thread to get the lock
|
|
|
|
// Wait for thread to get the lock
|
|
|
|
cv.wait(l, [&](){return has_lock;}); |
|
|
|
cv.wait(l, [&](){return has_lock;}); |
|
|
|