From 2bd1ae9ff63999a8016d068cef4ee00a36d82c7a Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Wed, 5 Jan 2022 19:51:36 +0900 Subject: [PATCH] Reduce length of thread name - According to glib manual, some systems restrict the length of thread name to 16 bytes. Previously, the thread name for camera API was not shown properly(checked by "ps -eTl"), and it has been fixed by reducing length of thread name. [Version] 0.4.70 [Issue Type] Update Change-Id: Ic79ff1719afe1a145db793463139e240b2bf397c Signed-off-by: Jeongmo Yang --- packaging/capi-media-camera.spec | 2 +- src/camera.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index f002e65..74a4cd2 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.4.69 +Version: 0.4.70 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index 578efee..d7e0dc0 100644 --- a/src/camera.c +++ b/src/camera.c @@ -2040,7 +2040,7 @@ static bool __create_msg_handler_thread(camera_msg_handler_info_s *handler_info, return false; } - CAM_LOG_INFO("t:%d", type); + CAM_LOG_INFO("t:%d [%s]", type, thread_name); handler_info->type = type; handler_info->queue = g_queue_new(); @@ -2138,14 +2138,14 @@ static camera_cb_info_s *__camera_client_callback_new(gint sockfd) /* message handler thread */ if (!__create_msg_handler_thread(&cb_info->msg_handler_info, - CAMERA_MESSAGE_HANDLER_TYPE_GENERAL, "camera_msg_handler", cb_info)) { + CAMERA_MESSAGE_HANDLER_TYPE_GENERAL, "cam:msg_handler", cb_info)) { CAM_LOG_ERROR("msg_handler_info failed"); goto ErrorExit; } /* message handler thread for capture callback */ if (!__create_msg_handler_thread(&cb_info->capture_cb_info, - CAMERA_MESSAGE_HANDLER_TYPE_CAPTURE_CB, "camera_msg_handler:capture_cb", cb_info)) { + CAMERA_MESSAGE_HANDLER_TYPE_CAPTURE_CB, "cam:capture_cb", cb_info)) { CAM_LOG_ERROR("capture_cb_info failed"); goto ErrorExit; } @@ -2154,7 +2154,7 @@ static camera_cb_info_s *__camera_client_callback_new(gint sockfd) /* message receive thread */ g_atomic_int_set(&cb_info->msg_recv_running, 1); - cb_info->msg_recv_thread = g_thread_try_new("camera_msg_recv", + cb_info->msg_recv_thread = g_thread_try_new("cam:msg_recv", __camera_msg_recv_func, (gpointer)cb_info, NULL); if (cb_info->msg_recv_thread == NULL) { CAM_LOG_ERROR("message receive thread creation failed"); @@ -2634,7 +2634,7 @@ int camera_start_preview(camera_h camera) if (current_state == CAMERA_STATE_CREATED) { if (!__create_msg_handler_thread(&pc->cb_info->preview_cb_info, - CAMERA_MESSAGE_HANDLER_TYPE_PREVIEW_CB, "camera_msg_handler:preview_cb", pc->cb_info)) { + CAMERA_MESSAGE_HANDLER_TYPE_PREVIEW_CB, "cam:preview_cb", pc->cb_info)) { CAM_LOG_ERROR("preview_cb_info failed"); return CAMERA_ERROR_INVALID_OPERATION; } -- 2.7.4