Exchange the current thread's active AsyncStackRoot with the specified AsyncStackRoot pointer, returning the old AsyncStackRoot pointer.
Declared in <folly/tracing/AsyncStack.h>
[[nodiscard]]
AsyncStackRoot*
exchangeCurrentAsyncStackRoot(AsyncStackRoot* newRoot) noexcept;
This is intended to be used to update the thread-local pointer when context-switching fiber stacks.
The previously active stack root, or null if there was none.
The return value should not be discarded.
| Name | Description |
|---|---|
| newRoot | The stack root to install as the current thread's root. |