Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions qsbr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1591,9 +1591,13 @@ class [[nodiscard]] qsbr_thread : public std::thread {
auto new_qsbr_per_thread = std::make_unique<qsbr_per_thread>();
return std::thread{
[inner_new_qsbr_per_thread = std::move(new_qsbr_per_thread)](
auto &&f2, auto &&...args2) mutable noexcept(noexcept(f2)) {
auto &&f2,
auto
&&...a2) mutable noexcept(noexcept(f2(std::
forward<decltype(a2)>(
a2)...))) {
qsbr_per_thread::set_instance(std::move(inner_new_qsbr_per_thread));
f2(std::forward<Args>(args2)...);
f2(std::forward<decltype(a2)>(a2)...);
},
std::forward<Function>(f), std::forward<Args>(args)...};
}
Expand Down
6 changes: 5 additions & 1 deletion test/qsbr_gtest_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ class QSBRTestBase : public ::testing::Test {
[]() noexcept { return unodb::this_thread().is_qsbr_paused(); });
}

static void qsbr_pause() {
static void qsbr_pause()
#ifndef UNODB_DETAIL_WITH_STATS
noexcept
#endif
{
unodb::test::must_not_allocate([]()
#ifndef UNODB_DETAIL_WITH_STATS
noexcept
Expand Down
6 changes: 5 additions & 1 deletion test/test_qsbr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ UNODB_TEST_F(QSBR, TwoThreads) {
}

UNODB_TEST_F(QSBR, TwoThreadsSecondQuitPaused) {
unodb::qsbr_thread second_thread([] { qsbr_pause(); });
unodb::qsbr_thread second_thread([]()
#ifndef UNODB_DETAIL_WITH_STATS
noexcept
#endif
{ qsbr_pause(); });
join(second_thread);
}

Expand Down
Loading