Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b353cf3
benchmark: fix punycode test for --without-intl
TimothyGu Oct 17, 2017
218b8fd
fs: fix `createReadStream(…, {end: n})` for non-seekable fds
addaleax Mar 13, 2018
986fd40
util: escaping object keys in util.inspect()
zheyz Nov 13, 2017
f0f7c2b
http: free the parser before emitting 'upgrade'
lpinca Jan 17, 2018
f068918
stream: remove unreachable code
lpinca Jan 18, 2018
9a56ad9
test: use correct size in test-stream-buffer-list
lpinca Jan 18, 2018
b665068
stream: simplify `src._readableState` to `state`
Jan 20, 2018
325dc27
doc: capitalize non-primitive types
vsemozhetbyt Jan 12, 2018
ddb42b5
doc: warn about GCM authenticity
tniessen Jan 25, 2018
9f02f29
doc: fix manpage warnings
silverwind Jan 29, 2018
c28a64a
doc: reorder section on updating PR branch
ofrobots Jan 24, 2018
67f9df9
url: simplify loop in parser
tniessen Jan 30, 2018
06c1ef7
doc: add Gibson Fahnestock to TSC
Trott Jan 31, 2018
de63954
test: fix flaky test-http-dns-error
bengl Oct 26, 2017
06a28aa
src: free memory before re-setting URLHost value
prog1dev Jan 23, 2018
4f1939b
tools: auto fix custom eslint rule
shobhitchittora Oct 31, 2017
9b0d337
doc: improve stream documentation
Jan 25, 2018
02eab11
test: speed up parallel/test-tls-session-cache
addaleax Jan 29, 2018
9f158ac
lib: remove debugger dead code
liqyan Jan 22, 2018
f4ccb9d
deps: update node-inspect to 1.11.3
Jan 24, 2018
cad0bbb
async_hooks: clean up comments
ofrobots Jan 30, 2018
b8d3c40
doc: move Brian White to TSC Emeriti list
Trott Jan 31, 2018
091ab5b
v8: add missing ',' in OpenBSD's 'sources' section.
qbit Jan 30, 2018
d594a68
build: add cflags for OpenBSD, remove stray comma.
qbit Jan 30, 2018
e6d6042
doc: streamline README intro
Trott Jan 31, 2018
5e86f20
string_decoder: reset decoder on end
jridgewell Feb 1, 2018
c570180
test: add test for tls benchmarks
apapirovski Feb 1, 2018
6ef1fa3
test: verify the shell option works properly on execFile
jvelezpo Jan 25, 2018
21441e8
win, build: fix intl-none option
poiru Jan 22, 2018
07f9147
doc: improve http.request documentation
Zarel Jan 8, 2018
0a5b0d5
doc: shell option for the execFile and execFileSync functions
jvelezpo Jan 18, 2018
89c1bf3
build: allow x86_64 as a dest_cpu alias for x64
rvagg Jan 9, 2018
2a18de3
test: remove destructor from node_test_fixture
danbev Feb 2, 2018
af3e5f2
net: remove redundant code from _writeGeneric()
lpinca Jan 29, 2018
433be0d
tools: add check for using process.binding crypto
danbev Dec 26, 2017
a3111ba
build: refine static and shared lib build
yhwang Dec 5, 2017
5590088
errors: remove ERR_OUTOFMEMORY
tniessen Dec 27, 2017
059a803
test: fix spelling in test case comments
tniessen Jan 6, 2018
63b0de2
lib: fix spelling in comments
tniessen Jan 6, 2018
790ef2f
test: update references to archived repository
tniessen Dec 31, 2017
8c25003
readline: update references to archived repository
tniessen Dec 31, 2017
f687bb1
test: move tmpdir to submodule of common
Trott Dec 25, 2017
9f380dc
tools: add .mjs linting for Windows
vsemozhetbyt Feb 4, 2018
88e0f23
test: add assertions for TextEncoder/Decoder
Jan 13, 2018
d503427
doc: linkify missing types
vsemozhetbyt Jan 29, 2018
bc66f08
deps: V8: backport 596d55a from upstream
MylesBorins Sep 18, 2017
44cb0d3
crypto: reuse variable instead of reevaluation
tniessen Dec 18, 2017
6ba7fd0
tools: non-Ascii linter for /lib only
Jan 8, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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: 83e5215
Ref: 0784b04
PR-URL: #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>
  • Loading branch information
ofrobots authored and MylesBorins committed Mar 28, 2018
commit cad0bbb3f6a00959464c51e149f9edc78976c7f3
23 changes: 12 additions & 11 deletions lib/internal/async_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,28 @@ 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
* side are used instead in pushAsyncIds() and popAsyncIds().
*/
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 Proimses when a hook is enabled.
const { enablePromiseHook, disablePromiseHook } = async_wrap;
Expand Down
4 changes: 2 additions & 2 deletions src/async_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,12 @@ void AsyncWrap::Initialize(Local<Object> target,
// this way to allow JS and C++ to read/write each value as quickly as
// possible. The fields are represented as follows:
//
// kAsyncUid: Maintains the state of the next unique id to be assigned.
// kAsyncIdCounter: Maintains the state of the next unique id to be assigned.
//
// kDefaultTriggerAsyncId: Write the id of the resource responsible for a
// handle's creation just before calling the new handle's constructor.
// After the new handle is constructed kDefaultTriggerAsyncId is set back
// to 0.
// to -1.
FORCE_SET_TARGET_FIELD(target,
"async_id_fields",
env->async_hooks()->async_id_fields().GetJSArray());
Expand Down