@@ -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
@@ -2011,6 +2022,17 @@ An integer identifier for the referenced thread. Inside the worker thread,
2011
2022
it is available as [` require('node:worker_threads').threadId` ][].
2012
2023
This value is unique for each ` Worker` instance inside a single process .
2013
2024
2025
+ ### ` worker.threadName`
2026
+
2027
+ <!-- YAML
2028
+ added: REPLACEME
2029
+ -->
2030
+
2031
+ * {string| null }
2032
+
2033
+ A string identifier for the referenced thread or null if the thread is not running.
2034
+ Inside the worker thread, it is available as [` require('node:worker_threads').threadName` ][].
2035
+
2014
2036
### ` worker.unref()`
2015
2037
2016
2038
<!-- YAML
@@ -2139,6 +2161,7 @@ thread spawned will spawn another until the application crashes.
2139
2161
[` require('node:worker_threads').parentPort.postMessage()` ]: #workerpostmessagevalue- transferlist
2140
2162
[` require('node:worker_threads').parentPort` ]: #workerparentport
2141
2163
[` require('node:worker_threads').threadId` ]: #workerthreadid
2164
+ [` require('node:worker_threads').threadName` ]: #workerthreadname
2142
2165
[` require('node:worker_threads').workerData` ]: #workerworkerdata
2143
2166
[` trace_events` ]: tracing .md
2144
2167
[` v8.getHeapSnapshot()` ]: v8 .md #v8getheapsnapshotoptions
@@ -2149,6 +2172,7 @@ thread spawned will spawn another until the application crashes.
2149
2172
[` worker.postMessage()` ]: #workerpostmessagevalue- transferlist
2150
2173
[` worker.terminate()` ]: #workerterminate
2151
2174
[` worker.threadId` ]: #workerthreadid_1
2175
+ [` worker.threadName` ]: #workerthreadname_1
2152
2176
[async - resource- worker- pool]: async_context .md #using- asyncresource- for - a- worker- thread- pool
2153
2177
[browser ` LockManager` ]: https: // developer.mozilla.org/en-US/docs/Web/API/LockManager
2154
2178
[browser ` MessagePort` ]: https: // developer.mozilla.org/en-US/docs/Web/API/MessagePort
0 commit comments