Improve handle creation performance 24/306024/2 accepted/tizen/unified/20240222.012638 accepted/tizen/unified/toolchain/20240311.065130 accepted/tizen/unified/x/20240222.211059
authorJiyong <jiyong.min@samsung.com>
Thu, 15 Feb 2024 07:40:28 +0000 (16:40 +0900)
committerJiyong <jiyong.min@samsung.com>
Thu, 15 Feb 2024 07:46:38 +0000 (16:46 +0900)
- reduce sleep time 200ms -> 10ms

Change-Id: Ie82869950491143d662c2f2e915941206b86be33

include/media_controller_private.h
packaging/capi-media-controller.spec
src/media_controller_ipc.c
svc/media_controller_db_util.c
svc/media_controller_socket.c

index 7856931..a9620e4 100644 (file)
@@ -250,21 +250,6 @@ extern "C" {
 
 #define DEFAULT_USER_UID 5001  /* owner */
 
-#define MC_MILLISEC_SLEEP(msec) \
-       do { \
-               if (msec) { \
-                       long sec_t = 0; \
-                       long nsec_t = 0; \
-                       long cal_time = msec * 1000000; \
-                       sec_t = cal_time / 1000000000; \
-                       nsec_t = cal_time % 1000000000; \
-                       struct timespec reqtime; \
-                       reqtime.tv_sec = sec_t; \
-                       reqtime.tv_nsec = nsec_t; \
-                       nanosleep(&reqtime, NULL); \
-               } \
-       } while (0)
-
 #define MC_BIT64_UNSET         0x0000000000000000
 #define MC_BIT64_SET           0x0000000000000001
 #define MC_SHIFT_IS_OK(x)      ((x < 32) ? TRUE : FALSE)
index bc8c19d..e4058f5 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-controller
 Summary:    A media controller library in Tizen Native API
-Version:    0.2.41
+Version:    0.2.42
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index 7a7d823..94acfa3 100644 (file)
@@ -481,7 +481,7 @@ static int __launch_service(mc_priv_type_e priv_type)
        mc_retvm_if(ret != MEDIA_CONTROLLER_ERROR_NONE, ret, "Fail to __activate_service");
 
        while (retry_count++ < MAX_WAIT_COUNT) {
-               MC_MILLISEC_SLEEP(200);
+               usleep(10000);
                mc_error("[No-Error] retry_count [%d]", retry_count);
                ret = _mc_ipc_send_message_to_server(MC_MSG_SERVICE_LAUNCH, priv_type, "launch");
                mc_retvm_if(ret == MEDIA_CONTROLLER_ERROR_NONE, ret, "service is running!");
index d6a8312..4985224 100644 (file)
@@ -75,7 +75,7 @@ ERROR:
 
 static int __mc_db_busy_handler(void *pData, int count)
 {
-       MC_MILLISEC_SLEEP(50);
+       usleep(50000);
 
        mc_error("[No-Error]__mc_db_busy_handler called : %d", count);
 
index b1282e4..63bd663 100644 (file)
@@ -74,7 +74,7 @@ int mc_ipc_create_server_socket(mc_msg_port_type_e port, int *sock_fd)
                        break;
                }
                mc_debug("%d", i);
-               MC_MILLISEC_SLEEP(50);
+               usleep(50000);
        }
 
        if (bind_success == false) {