summaryrefslogtreecommitdiff
path: root/chromium/v8/include/cppgc/internal/process-heap.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/v8/include/cppgc/internal/process-heap.h')
-rw-r--r--chromium/v8/include/cppgc/internal/process-heap.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/chromium/v8/include/cppgc/internal/process-heap.h b/chromium/v8/include/cppgc/internal/process-heap.h
new file mode 100644
index 00000000000..0f742a50a9c
--- /dev/null
+++ b/chromium/v8/include/cppgc/internal/process-heap.h
@@ -0,0 +1,34 @@
+// Copyright 2020 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef INCLUDE_CPPGC_INTERNAL_PROCESS_HEAP_H_
+#define INCLUDE_CPPGC_INTERNAL_PROCESS_HEAP_H_
+
+#include "cppgc/internal/atomic-entry-flag.h"
+#include "v8config.h" // NOLINT(build/include_directory)
+
+namespace cppgc {
+namespace internal {
+
+class V8_EXPORT ProcessHeap final {
+ public:
+ static void EnterIncrementalOrConcurrentMarking() {
+ concurrent_marking_flag_.Enter();
+ }
+ static void ExitIncrementalOrConcurrentMarking() {
+ concurrent_marking_flag_.Exit();
+ }
+
+ static bool IsAnyIncrementalOrConcurrentMarking() {
+ return concurrent_marking_flag_.MightBeEntered();
+ }
+
+ private:
+ static AtomicEntryFlag concurrent_marking_flag_;
+};
+
+} // namespace internal
+} // namespace cppgc
+
+#endif // INCLUDE_CPPGC_INTERNAL_PROCESS_HEAP_H_