Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
fix: patch issues with workers #282 (#288)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
matthias-heller authored Mar 27, 2023
1 parent 75f1e00 commit 0098fa8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions patches/node.v18.15.0.cpp.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions patches/node.v19.8.1.cpp.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0098fa8

Please sign in to comment.