v8 12.4.254 (node 22.4.1)
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
124 // Disallow copying and assigning.
125 Locker(const Locker&) = delete;
126 void operator=(const Locker&) = delete;
127
128 private:
129 void Initialize(Isolate* isolate);
130
131 bool has_lock_;
132 bool top_level_;
133 internal::Isolate* isolate_;
134};
135
136} // namespace v8
137
138#endif // INCLUDE_V8_LOCKER_H_
static bool IsLocked(Isolate *isolate)
Locker(const Locker &)=delete
void operator=(const Locker &)=delete
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:753
#define V8_INLINE
Definition v8config.h:477