Skip to content

Commit 95ad70a

Browse files
committed
test: Default initialize should_freeze to true
It is safe now, when move semantics is used instead of a custom swap function.
1 parent cea5052 commit 95ad70a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/test/checkqueue_tests.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ struct FrozenCleanupCheck {
109109
static std::atomic<uint64_t> nFrozen;
110110
static std::condition_variable cv;
111111
static std::mutex m;
112-
// Freezing can't be the default initialized behavior given how the queue
113-
// swaps in default initialized Checks.
114-
bool should_freeze {false};
112+
bool should_freeze{true};
115113
bool operator()() const
116114
{
117115
return true;
@@ -344,10 +342,6 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)
344342
std::thread t0([&]() {
345343
CCheckQueueControl<FrozenCleanupCheck> control(queue.get());
346344
std::vector<FrozenCleanupCheck> vChecks(1);
347-
// Freezing can't be the default initialized behavior given how the queue
348-
// swaps in default initialized Checks (otherwise freezing destructor
349-
// would get called twice).
350-
vChecks[0].should_freeze = true;
351345
control.Add(std::move(vChecks));
352346
bool waitResult = control.Wait(); // Hangs here
353347
assert(waitResult);

0 commit comments

Comments
 (0)