0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 00:14:07 +01:00

fixup! ircd::ctx: Fixes for the thread-unsafety of asio::steady_timer.

This commit is contained in:
Jason Volk 2017-03-30 21:12:36 -07:00
parent a2625b9f4b
commit e4f258314a

View file

@ -149,7 +149,7 @@ ircd::ctx::ctx::jump()
} }
assert(current != this); assert(current != this);
assert(notes = 1); // notes = 1; set by continuation dtor on wakeup assert(notes == 1); // notes = 1; set by continuation dtor on wakeup
interruption_point(); interruption_point();
} }
@ -766,14 +766,14 @@ ircd::ctx::ole::offload(const std::function<void ()> &func)
{ {
bool done(false); bool done(false);
auto *const context(current); auto *const context(current);
const auto notifier([&context, &done] const auto kick([&context, &done]
{ {
done = true; done = true;
notify(*context); notify(*context);
}); });
std::exception_ptr eptr; std::exception_ptr eptr;
auto closure([&func, &eptr, &context, &notifier] auto closure([&func, &eptr, &context, &kick]
() noexcept () noexcept
{ {
try try
@ -785,7 +785,7 @@ ircd::ctx::ole::offload(const std::function<void ()> &func)
eptr = std::current_exception(); eptr = std::current_exception();
} }
context->strand.post(notifier); context->strand.post(kick);
}); });
push(std::move(closure)); do push(std::move(closure)); do