0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

src: rename WorkerThreadMain to PlatformWorkerThread

Refs: https://github.com/nodejs/node/pull/21079#discussion_r194251183

PR-URL: https://github.com/nodejs/node/pull/21982
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Michaël Zasso 2018-07-26 08:41:57 +02:00
parent e3a47025ac
commit afc5636fe6
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600
2 changed files with 4 additions and 4 deletions

View File

@ -17,9 +17,9 @@ using v8::TracingController;
namespace {
static void WorkerThreadMain(void* data) {
static void PlatformWorkerThread(void* data) {
TRACE_EVENT_METADATA1("__metadata", "thread_name", "name",
"BackgroundTaskRunner");
"PlatformWorkerThread");
TaskQueue<Task>* pending_worker_tasks = static_cast<TaskQueue<Task>*>(data);
while (std::unique_ptr<Task> task = pending_worker_tasks->BlockingPop()) {
task->Run();
@ -32,7 +32,7 @@ static void WorkerThreadMain(void* data) {
WorkerThreadsTaskRunner::WorkerThreadsTaskRunner(int thread_pool_size) {
for (int i = 0; i < thread_pool_size; i++) {
std::unique_ptr<uv_thread_t> t { new uv_thread_t() };
if (uv_thread_create(t.get(), WorkerThreadMain,
if (uv_thread_create(t.get(), PlatformWorkerThread,
&pending_worker_tasks_) != 0) {
break;
}

View File

@ -31,7 +31,7 @@ proc.once('exit', common.mustCall(() => {
trace.args.name === 'JavaScriptMainThread'));
assert(traces.some((trace) =>
trace.name === 'thread_name' &&
trace.args.name === 'BackgroundTaskRunner'));
trace.args.name === 'PlatformWorkerThread'));
assert(traces.some((trace) =>
trace.name === 'version' &&
trace.args.node === process.versions.node));