Commit 39dba3a0 authored by Kenny Yu's avatar Kenny Yu Committed by Facebook GitHub Bot

Make AsyncStackRoot::getTopFrame() const

Summary:
This is needed if we have an AsyncStackRoot pointer, and we
want to call both `getTopFrame()` and `getNextRoot()`
(e.g. walking async stacks) without const-casting the pointer.

Reviewed By: yfeldblum

Differential Revision: D26675131

fbshipit-source-id: 84de25c67d563e118483d67d0fedb4ea7aef2604
parent 85b28533
......@@ -108,7 +108,7 @@ inline void AsyncStackRoot::setTopFrame(AsyncStackFrame& frame) noexcept {
this->topFrame.store(&frame, std::memory_order_release);
}
inline AsyncStackFrame* AsyncStackRoot::getTopFrame() noexcept {
inline AsyncStackFrame* AsyncStackRoot::getTopFrame() const noexcept {
return topFrame.load(std::memory_order_relaxed);
}
......
......@@ -377,7 +377,7 @@ struct AsyncStackRoot {
// The current stack root must not currently have any active
// frame.
void setTopFrame(AsyncStackFrame& frame) noexcept;
AsyncStackFrame* getTopFrame() noexcept;
AsyncStackFrame* getTopFrame() const noexcept;
// Initialises this stack root with information about the context
// in which the stack-root was declared. This records information
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment