Uh oh!
There was an error while loading. Please reload this page.
src: use thread_local to declare modpending - #28456
Conversation
There was a problem hiding this comment.
Just node_module*, no struct (see lines above), and the = nullptr isn't strictly necessary.
There was a problem hiding this comment.
👍 on the node_module*, but I'd like to keep the initialization because we do a
CHECK_NULL(thread_local_modpending);later on, and I'm not 100% sure that these variables get initialized on every platform.
There was a problem hiding this comment.
OK, looks like the variable oughta get zeroed out: https://en.cppreference.com/w/cpp/language/initialization#Static_initialization
b2ad535 to
72fb292Comparenodejs-github-bot
commented
Jul 1, 2019
nodejs-github-bot
commented
Jul 1, 2019
nodejs-github-bot
commented
Jul 2, 2019
nodejs-github-bot
commented
Jul 2, 2019
nodejs-github-bot
commented
Jul 2, 2019
The pointer used to hold an incoming dynamically loaded module's `node::node_module` structure needs to be thread-local. So far this was done with `uv_key_set()` and `uv_key_get()`. The language now supports the `thread_local` keyword which makes implementing this a lot cleaner.
72fb292 to
e7b6417Comparegabrielschulhof
commented
Jul 2, 2019
Let's see if rebasing makes a difference for the CI. |
nodejs-github-bot
commented
Jul 2, 2019
nodejs-github-bot
commented
Jul 2, 2019
nodejs-github-bot
commented
Jul 2, 2019
CI: https://ci.nodejs.org/job/node-test-pull-request/24227/ |
gabrielschulhof
commented
Jul 2, 2019
Landed in d3b10f6. |
The pointer used to hold an incoming dynamically loaded module's `node::node_module` structure needs to be thread-local. So far this was done with `uv_key_set()` and `uv_key_get()`. The language now supports the `thread_local` keyword which makes implementing this a lot cleaner. PR-URL: nodejs#28456 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The pointer used to hold an incoming dynamically loaded module's `node::node_module` structure needs to be thread-local. So far this was done with `uv_key_set()` and `uv_key_get()`. The language now supports the `thread_local` keyword which makes implementing this a lot cleaner. PR-URL: #28456 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The pointer used to hold an incoming dynamically loaded module's
node::node_modulestructure needs to be thread-local. So far this wasdone with
uv_key_set()anduv_key_get(). The language now supportsthe
thread_localkeyword which makes implementing this a lot cleaner.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes