@@ -33,9 +33,7 @@ public:
|
||||
cb();
|
||||
}
|
||||
|
||||
void sync(std::promise<void> barrier) {
|
||||
barrier.set_value();
|
||||
}
|
||||
void sync(std::promise<void> barrier) { barrier.set_value(); }
|
||||
|
||||
private:
|
||||
AsyncTask *async;
|
||||
@@ -75,8 +73,9 @@ TEST(AsyncTask, DestroyShouldNotRunQueue) {
|
||||
TEST(AsyncTask, DestroyAfterSignaling) {
|
||||
RunLoop loop;
|
||||
|
||||
// We're creating two tasks and signal both of them; the one that gets fired first destroys
|
||||
// the other one. Make sure that the second one we destroyed doesn't fire.
|
||||
// We're creating two tasks and signal both of them; the one that gets fired
|
||||
// first destroys the other one. Make sure that the second one we destroyed
|
||||
// doesn't fire.
|
||||
|
||||
std::unique_ptr<AsyncTask> task1, task2;
|
||||
|
||||
@@ -142,7 +141,9 @@ TEST(AsyncTask, ThreadSafety) {
|
||||
|
||||
for (unsigned i = 0; i < numThreads; ++i) {
|
||||
// The callback runs on the worker, thus the atomic type.
|
||||
workerRef.invoke(&TestWorker::runWithCallback, [&] { if (!--completed) loop.stop(); });
|
||||
workerRef.invoke(&TestWorker::runWithCallback, [&] {
|
||||
if (!--completed) loop.stop();
|
||||
});
|
||||
}
|
||||
|
||||
loop.run();
|
||||
|
||||
Reference in New Issue
Block a user