Skip to content
Snippets Groups Projects

[Context] Move switchToOriginalStack() into module and add DBG statement

2 files
+ 11
8
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 9
1
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright © 2020 Florian Schmaus
// Copyright © 2020-2022 Florian Schmaus
#include "Context.hpp"
#include <ostream>
@@ -22,3 +22,11 @@ auto operator<<(std::ostream& strm, const Context& context) -> std::ostream& {
<< "]";
return strm;
}
[[noreturn]] void Context::switchToOriginalStack() {
// Can't use new context hook to communicate the context to free.
lastContextBeforeReturningToOriginalStack = currentContext;
currentContext = nullptr;
DBG("Switchting to original stack " << &originalStack << " from " << currentContext);
switch_and_load_context(&originalStack);
}
Loading