Reduce length of thread name 69/268969/2 accepted/tizen/unified/20220107.120842 submit/tizen/20220106.070305
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 5 Jan 2022 10:51:36 +0000 (19:51 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Thu, 6 Jan 2022 03:40:25 +0000 (12:40 +0900)
- 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 <jm80.yang@samsung.com>
packaging/capi-media-camera.spec
src/camera.c

index f002e65..74a4cd2 100644 (file)
@@ -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
index 578efee..d7e0dc0 100644 (file)
@@ -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;
                }