v8 10.2.154 (node 18.16.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
v8-locker.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_V8_LOCKER_H_
6#define INCLUDE_V8_LOCKER_H_
7
8#include "v8config.h" // NOLINT(build/include_directory)
9
10namespace v8 {
11
12namespace internal {
13class Isolate;
14} // namespace internal
15
16class Isolate;
17
95 public:
99 V8_INLINE explicit Unlocker(Isolate* isolate) { Initialize(isolate); }
100
102
103 private:
104 void Initialize(Isolate* isolate);
105
106 internal::Isolate* isolate_;
107};
108
110 public:
114 V8_INLINE explicit Locker(Isolate* isolate) { Initialize(isolate); }
115
117
122 static bool IsLocked(Isolate* isolate);
123
130 V8_DEPRECATE_SOON("This method will be removed.")
131 static bool WasEverUsed();
132 V8_DEPRECATED("Use WasEverUsed instead")
133 static bool IsActive();
134
135 // Disallow copying and assigning.
136 Locker(const Locker&) = delete;
137 void operator=(const Locker&) = delete;
138
139 private:
140 void Initialize(Isolate* isolate);
141
142 bool has_lock_;
143 bool top_level_;
144 internal::Isolate* isolate_;
145};
146
147} // namespace v8
148
149#endif // INCLUDE_V8_LOCKER_H_
static bool IsLocked(Isolate *isolate)
V8_INLINE Locker(Isolate *isolate)
Definition v8-locker.h:114
V8_INLINE Unlocker(Isolate *isolate)
Definition v8-locker.h:99
#define V8_EXPORT
Definition v8config.h:578
#define V8_INLINE
Definition v8config.h:425
#define V8_DEPRECATE_SOON(message)
Definition v8config.h:470
#define V8_DEPRECATED(message)
Definition v8config.h:462