Native: support reentrant mode for CalledFromNativeGuard
This commit is contained in:
committed by
Space
parent
1bcafd3cd0
commit
85ab4f68df
@@ -447,13 +447,15 @@ private:
|
||||
// No-op for old GC.
|
||||
class CalledFromNativeGuard final : private Pinned {
|
||||
public:
|
||||
ALWAYS_INLINE CalledFromNativeGuard() noexcept;
|
||||
ALWAYS_INLINE CalledFromNativeGuard(bool reentrant = false) noexcept;
|
||||
|
||||
~CalledFromNativeGuard() noexcept {
|
||||
SwitchThreadState(thread_, ThreadState::kNative);
|
||||
SwitchThreadState(thread_, oldState_, reentrant_);
|
||||
}
|
||||
private:
|
||||
MemoryState* thread_;
|
||||
ThreadState oldState_;
|
||||
bool reentrant_;
|
||||
};
|
||||
|
||||
template <ThreadState state, typename R, typename... Args>
|
||||
|
||||
Reference in New Issue
Block a user