g_mutex_lock(&(cb_info->api_mutex[api]));
if (cb_info->api_activating[api] == 0) {
- end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND;
- if (g_cond_wait_until(&(cb_info->api_cond[api]), &(cb_info->api_mutex[api]), end_time)) {
+ if (time_out == RECORDER_CB_NO_TIMEOUT) {
+ LOGW("wait for api %d", api);
+ g_cond_wait(&(cb_info->api_cond[api]), &(cb_info->api_mutex[api]));
ret = cb_info->api_ret[api];
cb_info->api_activating[api] = 0;
-
- /*LOGD("return value : 0x%x", ret);*/
+ LOGW("api %d returned 0x%x", api, ret);
} else {
- ret = RECORDER_ERROR_INVALID_OPERATION;
-
- LOGE("api %d was TIMED OUT!", api);
+ end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND;
+ if (g_cond_wait_until(&(cb_info->api_cond[api]), &(cb_info->api_mutex[api]), end_time)) {
+ ret = cb_info->api_ret[api];
+ cb_info->api_activating[api] = 0;
+ /*LOGD("return value : 0x%x", ret);*/
+ } else {
+ ret = RECORDER_ERROR_INVALID_OPERATION;
+ LOGE("api %d was TIMED OUT!", api);
+ }
}
} else {
ret = cb_info->api_ret[api];
sock_fd = -1;
- ret = _recorder_client_wait_for_cb_return(MUSE_RECORDER_API_CREATE, pc->cb_info, RECORDER_CB_TIMEOUT);
+ ret = _recorder_client_wait_for_cb_return(MUSE_RECORDER_API_CREATE, pc->cb_info, RECORDER_CB_NO_TIMEOUT);
pc->cb_info->api_waiting[MUSE_RECORDER_API_CREATE] = 0;