Description:add thread name

Match-id-969f827bd02afa09506a41ba7bc6f3760b1b64fd
This commit is contained in:
xxxx
2023-03-02 21:26:04 +08:00
parent b59fe3b8d8
commit c52ae9a664
7 changed files with 52 additions and 13 deletions
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -18,6 +18,7 @@
#include <cstring>
#include <dirent.h>
#include <fcntl.h>
#include <pthread.h>
#include <sstream>
#include <sys/stat.h>
#include <unistd.h>
@@ -177,6 +178,10 @@ bool DistributedInputHandler::InitCollectEventsThread()
void *DistributedInputHandler::CollectEventsThread(void *param)
{
int32_t ret = pthread_setname_np(pthread_self(), COLLECT_EVENT_THREAD_NAME);
if (ret != 0) {
DHLOGE("CollectEventsThread setname failed.");
}
DistributedInputHandler *pThis = reinterpret_cast<DistributedInputHandler *>(param);
std::string deviceId;