Skip to content

Commit

Permalink
locked_queue: we can't use std::deferred
Browse files Browse the repository at this point in the history
It seems like with std::deferred this doesn't work as intended with
older compilers.
  • Loading branch information
julianoes committed May 11, 2018
1 parent 2ca64a7 commit 701e27a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/locked_queue_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TEST(LockedQueue, ConcurrantAccess)
auto prom = std::make_shared<std::promise<void>>();
auto fut = prom->get_future();

auto some_future = std::async(std::launch::async | std::launch::deferred,
auto some_future = std::async(std::launch::async,
[&prom, &locked_queue]() {
// This will wait in the lock until the first item is returned.
auto second_borrowed_item = locked_queue.borrow_front();
Expand All @@ -96,7 +96,6 @@ TEST(LockedQueue, ConcurrantAccess)
EXPECT_EQ(status, std::future_status::timeout);

locked_queue.return_front();

status = fut.wait_for(std::chrono::milliseconds(100));
status = fut.wait_for(std::chrono::milliseconds(10));
EXPECT_EQ(status, std::future_status::ready);
}

0 comments on commit 701e27a

Please sign in to comment.