[Tizen] Set ThreadName for AsyncTask 18/304218/2
authorsunghyun kim <scholb.kim@samsung.com>
Fri, 12 Jan 2024 06:35:23 +0000 (15:35 +0900)
committersunghyun kim <scholb.kim@samsung.com>
Fri, 12 Jan 2024 07:58:46 +0000 (16:58 +0900)
Set Threadname using GetTaskName()
it is useful for debug

Change-Id: I73ab292bc8c4c143648f5848b3b6a1d606e8aaf4

dali/internal/system/common/async-task-manager-impl.cpp

index 0d4c756..2064dfd 100644 (file)
@@ -164,6 +164,16 @@ void AsyncTaskThread::Run()
     else
     {
       DALI_LOG_INFO(gAsyncTasksManagerLogFilter, Debug::General, "Thread[%u] Process task [%p][%s]\n", threadId, task.Get(), GetTaskName(task));
+      std::string_view userThreadName = task->GetTaskName();
+      if(userThreadName.size() > 0)
+      {
+        SetThreadName(std::string(userThreadName.data()) + "Thread");
+      }
+      else
+      {
+        SetThreadName("AsyncTaskThread");
+      }
+
       task->Process();
       DALI_LOG_INFO(gAsyncTasksManagerLogFilter, Debug::General, "Thread[%u] Complete task [%p][%s]\n", threadId, task.Get(), GetTaskName(task));
       if(!mDestroyThread)