surface_queue: use MONOTOINIC timer in pthread_cond
[platform/core/uifw/libtbm.git] / src / tbm_surface_internal.c
index 6edc597..cf98f86 100644 (file)
@@ -837,7 +837,7 @@ tbm_surface_internal_create_with_flags(int width, int height,
 
                                bo->bufmgr = surf->bufmgr;
 
-                               pthread_mutex_lock(&surf->bufmgr->lock);
+                               _tbm_bufmgr_mutex_lock();
 
                                bo_data = bufmgr->bufmgr_func->bufmgr_alloc_bo_with_format(bufmgr->bufmgr_data, format, i,
                                                                                                                                width, height, flags, &error);
@@ -845,7 +845,7 @@ tbm_surface_internal_create_with_flags(int width, int height,
                                        TBM_ERR("fail to alloc bo priv. error(%d)\n", error);
                                        _tbm_set_last_result(error);
                                        free(bo);
-                                       pthread_mutex_unlock(&surf->bufmgr->lock);
+                                       _tbm_bufmgr_mutex_unlock();
                                        goto alloc_bo_fail;
                                }
                                bo->bo_data = bo_data;
@@ -856,7 +856,7 @@ tbm_surface_internal_create_with_flags(int width, int height,
 
                                LIST_ADD(&bo->item_link, &surf->bufmgr->bo_list);
 
-                               pthread_mutex_unlock(&surf->bufmgr->lock);
+                               _tbm_bufmgr_mutex_unlock();
 
                                surf->bos[i] = bo;
                                /* LCOV_EXCL_STOP */
@@ -879,14 +879,14 @@ tbm_surface_internal_create_with_flags(int width, int height,
 
                                bo->bufmgr = surf->bufmgr;
 
-                               pthread_mutex_lock(&surf->bufmgr->lock);
+                               _tbm_bufmgr_mutex_lock();
 
                                bo_priv = bufmgr->backend->surface_bo_alloc(bo, width, height, format, flags, i);
                                if (!bo_priv) {
                                        TBM_ERR("fail to alloc bo priv\n");
                                        _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
                                        free(bo);
-                                       pthread_mutex_unlock(&surf->bufmgr->lock);
+                                       _tbm_bufmgr_mutex_unlock();
                                        goto alloc_bo_fail;
                                }
                                bo->priv = bo_priv;
@@ -897,7 +897,7 @@ tbm_surface_internal_create_with_flags(int width, int height,
 
                                LIST_ADD(&bo->item_link, &surf->bufmgr->bo_list);
 
-                               pthread_mutex_unlock(&surf->bufmgr->lock);
+                               _tbm_bufmgr_mutex_unlock();
 
                                surf->bos[i] = bo;
                                /* LCOV_EXCL_STOP */
@@ -2609,7 +2609,7 @@ tbm_surface_internal_get_damage(tbm_surface_h surface, int *x, int *y, int *widt
        if (height) *height = surf->damage.height;
 
        TBM_TRACE_SURFACE_INTERNAL("tbm_surface(%p) x(%d) y(%d) width(%d) height(%d)\n",
-                                                       surface, *x, *y, *width, *height);
+                                                       surface, surf->damage.x, surf->damage.y, surf->damage.width, surf->damage.height);
 
        _tbm_surface_mutex_unlock();