continue;
}
- if (gsc_handle->cur_obj_mutex)
+ /* Trade temporary object for one in the pool */
+ if (gsc_handle->cur_obj_mutex) {
exynos_mutex_unlock(gsc_handle->cur_obj_mutex);
+ if (gsc_handle->destroy_cur_obj_mutex)
+ exynos_mutex_destroy(gsc_handle->cur_obj_mutex);
+ }
+ gsc_handle->destroy_cur_obj_mutex = false;
gsc_handle->cur_obj_mutex = gsc_handle->obj_mutex[i];
flag_find_new_gsc = true;
gsc_handle->obj_mutex[i] = NULL;
gsc_handle->cur_obj_mutex = NULL;
+ gsc_handle->destroy_cur_obj_mutex = false;
gsc_handle->flag_local_path = false;
gsc_handle->flag_exclusive_open = false;
gsc_handle->gsc_fd = -1;
gsc_handle->op_mutex = NULL;
gsc_handle->cur_obj_mutex = NULL;
+ gsc_handle->destroy_cur_obj_mutex = true;
sprintf(mutex_name, "%sObject%d", LOG_TAG, dev_num);
gsc_handle->cur_obj_mutex = exynos_mutex_create(EXYNOS_MUTEX_TYPE_SHARED, mutex_name);
gsc_handle->obj_mutex[i] = NULL;
gsc_handle->cur_obj_mutex = NULL;
+ gsc_handle->destroy_cur_obj_mutex = false;
gsc_handle->flag_local_path = false;
gsc_handle->flag_exclusive_open = true;
ALOGE("%s::exynos_mutex_create(%s) fail", __func__, mutex_name);
goto err;
}
+ gsc_handle->destroy_cur_obj_mutex = true;
do {
if (exynos_mutex_trylock(gsc_handle->cur_obj_mutex) == true) {
if (gsc_handle) {
m_exynos_gsc_destroy(gsc_handle);
- if (gsc_handle->cur_obj_mutex)
+ if (gsc_handle->cur_obj_mutex) {
exynos_mutex_unlock(gsc_handle->cur_obj_mutex);
+ if (gsc_handle->destroy_cur_obj_mutex)
+ exynos_mutex_destroy(gsc_handle->cur_obj_mutex);
+ }
for (i = 0; i < NUM_OF_GSC_HW; i++) {
if ((gsc_handle->obj_mutex[i] != NULL) &&
}
}
+ if (gsc_handle->destroy_cur_obj_mutex)
+ exynos_mutex_destroy(gsc_handle->cur_obj_mutex);
+
exynos_mutex_unlock(gsc_handle->op_mutex);
if (exynos_mutex_destroy(gsc_handle->op_mutex) == false)