Merge "[Bugfix][T106][bug-view-2278] Fixed the bug that when calling the WiFi interface, the audio recording and playback would be blocked abnormally" into INTEST_PM_SDK6.1_2WIFI
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c
index 9fa6d06..66404b7 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c
@@ -62,6 +62,7 @@
 static sc_ipc_event_ex s_evt_list;

 static sc_ipc_registrant s_registrant_list;

 static long s_ipc_msg_cnt = 0;

+static int s_ipc_ref_cnt = 0;

 

 static void sc_ipc_event_init(void);

 static void sc_ipc_event_set(sc_ipc_event *pevt, int fd, int msg_id, int persist, sc_ipc_event_cb func, void *param);

@@ -652,6 +653,7 @@
     pthread_attr_t attr;

 

     pthread_mutex_lock(&s_startupMutex);

+    s_ipc_ref_cnt++;

     if(s_started)

 		goto done;

 	sem_init(&terminate_sem, 0, 0);

@@ -677,8 +679,11 @@
 {

     int ret = 0;

     sc_ipc_msg msg = {0};

+    pthread_mutex_lock(&s_startupMutex);

+    s_ipc_ref_cnt--;

+    pthread_mutex_unlock(&s_startupMutex);

 

-	if(!s_started)

+	if(!s_started || s_ipc_ref_cnt > 0)

 		goto Done;

 

     msg.type = 0;