mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Redesign stoppable object pattern
This commit is contained in:
committed by
manojsdoshi
parent
c10c0be11b
commit
a2a37a928a
@@ -47,13 +47,11 @@ class JobQueue_test : public beast::unit_test::suite
|
||||
;
|
||||
}
|
||||
{
|
||||
// If the JobQueue's JobCounter is join()ed we should no
|
||||
// If the JobQueue is stopped, we should no
|
||||
// longer be able to add Jobs (and calling addJob() should
|
||||
// return false).
|
||||
using namespace std::chrono_literals;
|
||||
beast::Journal j{env.app().journal("JobQueue_test")};
|
||||
JobCounter& jCounter = jQueue.jobCounter();
|
||||
jCounter.join("JobQueue_test", 1s, j);
|
||||
jQueue.stop();
|
||||
|
||||
// The Job should never run, so having the Job access this
|
||||
// unprotected variable on the stack should be completely safe.
|
||||
@@ -132,13 +130,11 @@ class JobQueue_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(yieldCount == 4);
|
||||
}
|
||||
{
|
||||
// If the JobQueue's JobCounter is join()ed we should no
|
||||
// If the JobQueue is stopped, we should no
|
||||
// longer be able to add a Coro (and calling postCoro() should
|
||||
// return false).
|
||||
using namespace std::chrono_literals;
|
||||
beast::Journal j{env.app().journal("JobQueue_test")};
|
||||
JobCounter& jCounter = jQueue.jobCounter();
|
||||
jCounter.join("JobQueue_test", 1s, j);
|
||||
jQueue.stop();
|
||||
|
||||
// The Coro should never run, so having the Coro access this
|
||||
// unprotected variable on the stack should be completely safe.
|
||||
|
||||
Reference in New Issue
Block a user