Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2018-01-31 00:49:40 +0300
committerAli Ijaz Sheikh <ofrobots@google.com>2018-02-01 20:56:51 +0300
commitad94be84f969f0d95e8dec9994ca51c19c3ccf28 (patch)
treed4b5a1c694380ed6a8ddc4ce2df5dee34ea86e62 /lib/internal/async_hooks.js
parenta36b47b7d3bed94f1a3312cc3c2484856569eb95 (diff)
async_hooks: clean up comments
With some of the recent work, some of the comments were no longer representative of the code, or were otherwise unclear. This commit fixes some obvious issues I found. Ref: https://github.com/nodejs/node/commit/83e5215a4e8438a43b9f0002b7a43e2fd2dd37a4 Ref: https://github.com/nodejs/node/commit/0784b0440c05464f79b857f7d8698fcc953d3fb3 PR-URL: https://github.com/nodejs/node/pull/18467 Reviewed-By: Andreas Madsen <amwebdk@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib/internal/async_hooks.js')
-rw-r--r--lib/internal/async_hooks.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js
index f1c98f13ac0..92cd9ba1e42 100644
--- a/lib/internal/async_hooks.js
+++ b/lib/internal/async_hooks.js
@@ -11,16 +11,17 @@ const async_wrap = process.binding('async_wrap');
* the various asynchronous states of the application. These are:
* kExecutionAsyncId: The async_id assigned to the resource responsible for the
* current execution stack.
- * kTriggerAsyncId: The trigger_async_id of the resource responsible for
- * the current execution stack.
+ * kTriggerAsyncId: The async_id of the resource that caused (or 'triggered')
+ * the resource corresponding to the current execution stack.
* kAsyncIdCounter: Incremental counter tracking the next assigned async_id.
* kDefaultTriggerAsyncId: Written immediately before a resource's constructor
- * that sets the value of the init()'s triggerAsyncId. The order of
- * retrieving the triggerAsyncId value is passing directly to the
- * constructor -> value set in kDefaultTriggerAsyncId -> executionAsyncId of
- * the current resource.
+ * that sets the value of the init()'s triggerAsyncId. The precedence order
+ * of retrieving the triggerAsyncId value is:
+ * 1. the value passed directly to the constructor
+ * 2. value set in kDefaultTriggerAsyncId
+ * 3. executionAsyncId of the current resource.
*
- * async_ids_fast_stack is a Float64Array that contains part of the async ID
+ * async_ids_stack is a Float64Array that contains part of the async ID
* stack. Each pushAsyncIds() call adds two doubles to it, and each
* popAsyncIds() call removes two doubles from it.
* It has a fixed size, so if that is exceeded, calls to the native
@@ -28,10 +29,10 @@ const async_wrap = process.binding('async_wrap');
*/
const { async_id_symbol, async_hook_fields, async_id_fields } = async_wrap;
// Store the pair executionAsyncId and triggerAsyncId in a std::stack on
-// Environment::AsyncHooks::ids_stack_ tracks the resource responsible for the
-// current execution stack. This is unwound as each resource exits. In the case
-// of a fatal exception this stack is emptied after calling each hook's after()
-// callback.
+// Environment::AsyncHooks::async_ids_stack_ tracks the resource responsible for
+// the current execution stack. This is unwound as each resource exits. In the
+// case of a fatal exception this stack is emptied after calling each hook's
+// after() callback.
const { pushAsyncIds: pushAsyncIds_, popAsyncIds: popAsyncIds_ } = async_wrap;
// For performance reasons, only track Promises when a hook is enabled.
const { enablePromiseHook, disablePromiseHook } = async_wrap;