Improve handle creation performance 25/306025/2 accepted/tizen/8.0/unified/20240222.093832
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:47:04 +0000 (16:47 +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 3587e07ee54074606ccef3525adc7b0953169c61..5680da861a54737267bcfe2826aca294ac54317e 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 bc1be54282e0b80cb8fce63a5a16af7050d1353c..ff27b0933d1a6942b2c5cc8e8de302cb079684c4 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-controller
 Summary:    A media controller library in Tizen Native API
-Version:    0.2.39
+Version:    0.2.40
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index 7a7d823363fd1e05ca4e58402bca2ddccbf3e304..94acfa3044191506e13cb001480bb193c744dc3b 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 25cd2ec0cb4054bde79c12cef6b3d59ab5430056..7f28e6f6b4fc09d61c84f2a1710dab2adcae0b27 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 b1282e4e5cadd7e5fd53caae9555a1c5cf8e947e..63bd6637b2f17224b5f0316b8bc3def1c00a9891 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) {