v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
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
101 ~Unlocker();
102
103 private:
104 void Initialize(Isolate* isolate);
105
107};
108
110 public:
114 V8_INLINE explicit Locker(Isolate* isolate) { Initialize(isolate); }
115
116 ~Locker();
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
134};
135
136} // namespace v8
137
138#endif // INCLUDE_V8_LOCKER_H_
bool top_level_
Definition v8-locker.h:132
bool has_lock_
Definition v8-locker.h:131
V8_INLINE Locker(Isolate *isolate)
Definition v8-locker.h:114
Locker(const Locker &)=delete
internal::Isolate * isolate_
Definition v8-locker.h:133
void operator=(const Locker &)=delete
internal::Isolate * isolate_
Definition v8-locker.h:106
V8_INLINE Unlocker(Isolate *isolate)
Definition v8-locker.h:99
#define V8_EXPORT
Definition v8config.h:800
#define V8_INLINE
Definition v8config.h:500