-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: distinguish refed/unrefed threadsafe Immediates #33320
Conversation
In some situations, it can be useful to use threadsafe callbacks on an `Environment` to perform cleanup operations that should run even when the process would otherwise be ending.
@@ -727,9 +727,9 @@ void Environment::SetUnrefImmediate(Fn&& cb) { | |||
} | |||
|
|||
template <typename Fn> | |||
void Environment::SetImmediateThreadsafe(Fn&& cb) { | |||
void Environment::SetImmediateThreadsafe(Fn&& cb, bool refed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer an enum rather than a magical boolean :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasnell Hm yeah … this reaches into the CallbackQueue
implementation which also takes this as a boolean argument and returns the result as a boolean, so maybe in a follow-up PR? I’d like to be consistent here…
In some situations, it can be useful to use threadsafe callbacks on an `Environment` to perform cleanup operations that should run even when the process would otherwise be ending. PR-URL: #33320 Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in e346261 |
In some situations, it can be useful to use threadsafe callbacks on an `Environment` to perform cleanup operations that should run even when the process would otherwise be ending. PR-URL: #33320 Reviewed-By: James M Snell <jasnell@gmail.com>
Refs: #33320 (comment) PR-URL: #33444 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
In some situations, it can be useful to use threadsafe callbacks on an `Environment` to perform cleanup operations that should run even when the process would otherwise be ending. PR-URL: #33320 Reviewed-By: James M Snell <jasnell@gmail.com>
In some situations, it can be useful to use threadsafe callbacks on an `Environment` to perform cleanup operations that should run even when the process would otherwise be ending. PR-URL: nodejs#33320 Reviewed-By: James M Snell <jasnell@gmail.com>
Refs: #33320 (comment) PR-URL: #33444 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Refs: nodejs#33320 (comment) PR-URL: nodejs#33444 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Refs: #33320 (comment) PR-URL: #33444 Backport-PR-URL: #34263 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
In some situations, it can be useful to use threadsafe callbacks
on an
Environment
to perform cleanup operations that should runeven when the process would otherwise be ending.
(Split out from #33321)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes