summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/node.cc5
-rw-r--r--src/node.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/node.cc b/src/node.cc
index ee114257d5..669155a908 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -4425,6 +4425,11 @@ void FreeEnvironment(Environment* env) {
}
+MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
+ return v8_platform.Platform();
+}
+
+
MultiIsolatePlatform* CreatePlatform(
int thread_pool_size,
v8::TracingController* tracing_controller) {
diff --git a/src/node.h b/src/node.h
index ab5d1c120f..5a491c1abf 100644
--- a/src/node.h
+++ b/src/node.h
@@ -251,6 +251,11 @@ NODE_EXTERN Environment* CreateEnvironment(IsolateData* isolate_data,
NODE_EXTERN void LoadEnvironment(Environment* env);
NODE_EXTERN void FreeEnvironment(Environment* env);
+// This returns the MultiIsolatePlatform used in the main thread of Node.js.
+// If NODE_USE_V8_PLATFORM haven't been defined when Node.js was built,
+// it returns nullptr.
+NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform();
+
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
int thread_pool_size,
v8::TracingController* tracing_controller);