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

ircd::ctx: Avoid any alloc for current reassertion on spawn.

This commit is contained in:
Jason Volk 2018-03-12 15:44:55 -07:00
parent 09923ff758
commit f7ecc4342b

View file

@ -569,9 +569,10 @@ ircd::ctx::context::context(const char *const &name,
}
// The current context must be reasserted if spawn returns here
const unwind recurrent([current(ircd::ctx::current)]
auto *const theirs(ircd::ctx::current);
const unwind recurrent([&theirs]
{
ircd::ctx::current = current;
ircd::ctx::current = theirs;
});
if(flags & DISPATCH)