@@ -721,6 +721,17 @@ An integer identifier for the current thread. On the corresponding worker object
721
721
(if there is any), it is available as [`worker.threadId`][].
722
722
This value is unique for each [`Worker`][] instance inside a single process.
723
723
724
+ ## `worker.threadName`
725
+
726
+ <!-- YAML
727
+ added: REPLACEME
728
+ -->
729
+
730
+ * {string|null}
731
+
732
+ A string identifier for the current thread or null if the thread is not running.
733
+ On the corresponding worker object (if there is any), it is available as [`worker.threadName`][].
734
+
724
735
## `worker.workerData`
725
736
726
737
<!-- YAML
@@ -2015,6 +2026,17 @@ An integer identifier for the referenced thread. Inside the worker thread,
2015
2026
it is available as [` require('node:worker_threads').threadId` ][].
2016
2027
This value is unique for each ` Worker` instance inside a single process .
2017
2028
2029
+ ### ` worker.threadName`
2030
+
2031
+ <!-- YAML
2032
+ added: REPLACEME
2033
+ -->
2034
+
2035
+ * {string| null }
2036
+
2037
+ A string identifier for the referenced thread or null if the thread is not running.
2038
+ Inside the worker thread, it is available as [` require('node:worker_threads').threadName` ][].
2039
+
2018
2040
### ` worker.unref()`
2019
2041
2020
2042
<!-- YAML
@@ -2143,6 +2165,7 @@ thread spawned will spawn another until the application crashes.
2143
2165
[` require('node:worker_threads').parentPort.postMessage()` ]: #workerpostmessagevalue- transferlist
2144
2166
[` require('node:worker_threads').parentPort` ]: #workerparentport
2145
2167
[` require('node:worker_threads').threadId` ]: #workerthreadid
2168
+ [` require('node:worker_threads').threadName` ]: #workerthreadname
2146
2169
[` require('node:worker_threads').workerData` ]: #workerworkerdata
2147
2170
[` trace_events` ]: tracing .md
2148
2171
[` v8.getHeapSnapshot()` ]: v8 .md #v8getheapsnapshotoptions
@@ -2153,6 +2176,7 @@ thread spawned will spawn another until the application crashes.
2153
2176
[` worker.postMessage()` ]: #workerpostmessagevalue- transferlist
2154
2177
[` worker.terminate()` ]: #workerterminate
2155
2178
[` worker.threadId` ]: #workerthreadid_1
2179
+ [` worker.threadName` ]: #workerthreadname_1
2156
2180
[async - resource- worker- pool]: async_context .md #using- asyncresource- for - a- worker- thread- pool
2157
2181
[browser ` LockManager` ]: https: // developer.mozilla.org/en-US/docs/Web/API/LockManager
2158
2182
[browser ` MessagePort` ]: https: // developer.mozilla.org/en-US/docs/Web/API/MessagePort
0 commit comments