0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd::ctx: Move principal interruption point into continuation.

This commit is contained in:
Jason Volk 2018-12-16 18:27:58 -08:00
parent 16ea21e9f3
commit ba10948e9d
2 changed files with 7 additions and 6 deletions

View file

@ -75,7 +75,7 @@ struct ircd::ctx::continuation
continuation(const predicate & = true_predicate,
const interruptor & = noop_interruptor);
~continuation() noexcept;
~continuation() noexcept(false);
};
/// This type of continuation should be used when yielding a context to a
@ -90,6 +90,7 @@ struct ircd::ctx::continuation
struct ircd::ctx::to_asio
:ircd::ctx::continuation
{
to_asio(const interruptor &);
to_asio() = default;
to_asio(const interruptor &);
~to_asio() noexcept(false) = default;
};

View file

@ -141,8 +141,6 @@ ircd::ctx::ctx::jump()
assert(current != this);
assert(current->notes == 1); // notes = 1; set by continuation dtor on wakeup
interruption_point();
}
/// Yield (suspend) this context until notified.
@ -189,7 +187,6 @@ ircd::ctx::ctx::wait()
assert(current == this);
assert(notes == 1); // notes = 1; set by continuation dtor on wakeup
interruption_point();
return true;
}
@ -878,7 +875,7 @@ ircd::ctx::continuation::continuation(const predicate &pred,
}
ircd::ctx::continuation::~continuation()
noexcept
noexcept(false)
{
ircd::ctx::current = self;
self->notes = 1;
@ -886,6 +883,8 @@ noexcept
// self->continuation is not null'ed here; it remains an invalid
// pointer while the context is awake.
self->interruption_point();
}
ircd::ctx::continuation::operator boost::asio::yield_context &()
@ -909,6 +908,7 @@ ircd::ctx::to_asio::to_asio(const interruptor &intr)
false_predicate, intr
}
{
self->interruption_point();
}
///////////////////////////////////////////////////////////////////////////////