0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-13 08:23:56 +01:00

ircd::ios: Assume direct dispatch; use epoch continuation closure.

This commit is contained in:
Jason Volk 2020-08-23 04:20:48 -07:00
parent f16eb0b558
commit 2381f07d2f

View file

@ -410,20 +410,20 @@ ircd::ios::dispatch::dispatch(descriptor &descriptor,
synchronous_t,
const std::function<void ()> &function)
{
const ctx::uninterruptible::nothrow ui;
const ctx::uninterruptible ui;
ctx::latch latch(1);
dispatch(descriptor, [&function, &latch]
assert(function);
ctx::continuation
{
const unwind uw{[&latch]
continuation::false_predicate, continuation::noop_interruptor, [&descriptor, &function]
(auto &yield)
{
latch.count_down();
}};
function();
});
latch.wait();
dispatch(descriptor, [&function]
{
function();
});
}
};
}
[[gnu::hot]]