src: use thread_local to declare modpending#28456
src: use thread_local to declare modpending#28456gabrielschulhof wants to merge 1 commit intonodejs:masterfrom
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
72fb292
Compare
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
e7b6417
Compare
|
Let's see if rebasing makes a difference for the CI. |
|
CI: https://ci.nodejs.org/job/node-test-pull-request/24227/ |
|
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
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