Files
node/test/parallel
Santiago Gimeno 39583f77d8 worker: avoid potential deadlock on NearHeapLimit
It can happen that the `NearHeapLimit` callback is called while calling
the `oninit()` function on `MessagePort` construction causing a deadlock
when the `Worker::Exit()` method is called, as the `mutex_` was already
held on the `CreateEnvMessagePort()` method. To fix it, just use the
`mutex_` to protect the `child_port_data_` variable and avoid holding it
when creating the `MessagePort`.
Also, return early from `Worker::Run()` if the worker message port
could not be created.

Fixes: https://github.com/nodejs/node/issues/38208

PR-URL: https://github.com/nodejs/node/pull/38403
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2021-11-26 06:32:44 -05:00
..
2020-12-08 13:42:23 +00:00
2020-01-03 01:44:54 +01:00
2020-12-08 13:42:23 +00:00
2020-12-08 13:42:23 +00:00
2020-12-08 13:42:23 +00:00
2020-12-08 13:42:23 +00:00
2020-12-08 13:42:23 +00:00
2020-12-08 13:42:23 +00:00
2020-12-08 13:42:23 +00:00
2020-12-08 13:42:23 +00:00
2020-12-08 13:42:23 +00:00
2020-01-03 01:44:54 +01:00
2021-08-31 10:54:59 -04:00
2020-12-08 13:42:23 +00:00
2021-06-11 09:29:52 +02:00
2020-12-08 13:42:23 +00:00
2020-07-16 17:08:56 -04:00
2020-12-08 13:42:23 +00:00
2019-12-25 12:24:42 +01:00
2019-12-25 12:24:42 +01:00
2021-09-04 10:03:29 +02:00
2020-04-07 16:30:14 +01:00
2020-04-07 16:30:14 +01:00
2020-03-19 10:56:45 +01:00