fix: patch issues with workers #282 (#288)

* Fix for issue #282 (node.js 18.15.0)

This commit solves issue #282 for node.js 18.15.0

* Fix for issue #282 (node.js 19.8.1) 

This commit solves issue #282 for node.js 19.8.1
This commit is contained in:
Matthias Heller 2023-03-27 12:33:24 +02:00 committed by GitHub
parent 75f1e002d6
commit 0098fa8a26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -186,14 +186,19 @@ new file mode 100644
index 0000000000..e97e9e524c
--- /dev/null
+++ node/lib/internal/bootstrap/pkg.js
@@ -0,0 +1,44 @@
@@ -0,0 +1,49 @@
+'use strict';
+
+const {
+ prepareWorkerThreadExecution,
+ prepareMainThreadExecution
+} = require('internal/process/pre_execution');
+
+prepareMainThreadExecution(true);
+if (internalBinding('worker').isMainThread) {
+ prepareMainThreadExecution(true);
+} else {
+ prepareWorkerThreadExecution();
+}
+
+(function () {
+ var __require__ = require;

View File

@ -186,14 +186,19 @@ new file mode 100644
index 0000000000..e97e9e524c
--- /dev/null
+++ node/lib/internal/bootstrap/pkg.js
@@ -0,0 +1,44 @@
@@ -0,0 +1,49 @@
+'use strict';
+
+const {
+ prepareWorkerThreadExecution,
+ prepareMainThreadExecution
+} = require('internal/process/pre_execution');
+
+prepareMainThreadExecution(true);
+if (internalBinding('worker').isMainThread) {
+ prepareMainThreadExecution(true);
+} else {
+ prepareWorkerThreadExecution();
+}
+
+(function () {
+ var __require__ = require;