#include "tbm_bufmgr_int.h"
#include "list.h"
-static pthread_mutex_t tbm_bo_lock = PTHREAD_MUTEX_INITIALIZER;
-static void _tbm_bo_mutex_unlock(void);
-
/* check condition */
#define TBM_BO_RETURN_IF_FAIL(cond) {\
if (!(cond)) {\
TBM_ERR("'%s' failed.\n", #cond);\
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);\
- _tbm_bo_mutex_unlock();\
+ _tbm_bufmgr_mutex_unlock();\
return;\
} \
}
if (!(cond)) {\
TBM_ERR("'%s' failed.\n", #cond);\
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);\
- _tbm_bo_mutex_unlock();\
+ _tbm_bufmgr_mutex_unlock();\
return val;\
} \
}
-/* LCOV_EXCL_START */
-static bool
-_tbm_bo_mutex_init(void)
-{
- static bool tbm_bo_mutex_init = false;
-
- if (tbm_bo_mutex_init)
- return true;
-
- if (pthread_mutex_init(&tbm_bo_lock, NULL)) {
- TBM_ERR("fail: Cannot pthread_mutex_init for tbm_bo_lock.\n");
- return false;
- }
-
- tbm_bo_mutex_init = true;
-
- return true;
-}
-
-static void
-_tbm_bo_mutex_lock(void)
-{
- if (!_tbm_bo_mutex_init()) {
- TBM_ERR("fail: _tbm_bo_mutex_init()\n");
- return;
- }
-
- pthread_mutex_lock(&tbm_bo_lock);
-}
-
-static void
-_tbm_bo_mutex_unlock(void)
-{
- pthread_mutex_unlock(&tbm_bo_lock);
-}
-
static char *
_tbm_flag_to_str(int f)
{
switch (bo->bufmgr->bo_lock_type) {
case TBM_BUFMGR_BO_LOCK_TYPE_ONCE:
if (bo->lock_cnt == 0) {
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
ret = _bo_lock(bo, device, opt);
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
if (ret)
bo->lock_cnt++;
} else
ret = 1;
break;
case TBM_BUFMGR_BO_LOCK_TYPE_ALWAYS:
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
ret = _bo_lock(bo, device, opt);
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
if (ret)
bo->lock_cnt++;
break;
tbm_backend_bo_data *bo_data;
tbm_error_e error;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(TBM_BUFMGR_IS_VALID(bufmgr), NULL);
TBM_ERR("error: fail to create of tbm_bo size(%d) flag(%s)\n",
size, _tbm_flag_to_str(flags));
_tbm_set_last_result(TBM_ERROR_OUT_OF_MEMORY);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return NULL;
/* LCOV_EXCL_STOP */
}
size, _tbm_flag_to_str(flags));
_tbm_set_last_result(error);
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return NULL;
/* LCOV_EXCL_STOP */
}
size, _tbm_flag_to_str(flags));
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return NULL;
/* LCOV_EXCL_STOP */
}
LIST_ADD(&bo->item_link, &bo->bufmgr->bo_list);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo;
}
tbm_bo
tbm_bo_ref(tbm_bo bo)
{
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), NULL);
TBM_TRACE_BO("bo(%p) ref_cnt(%d)\n", bo, bo->ref_cnt);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo;
}
void
tbm_bo_unref(tbm_bo bo)
{
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_IF_FAIL(_tbm_bo_is_valid(bo));
TBM_TRACE_BO("bo(%p) ref_cnt(%d)\n", bo, bo->ref_cnt - 1);
if (bo->ref_cnt <= 0) {
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return;
}
if (bo->ref_cnt == 0)
_tbm_bo_free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
}
tbm_bo_handle
tbm_bo_handle bo_handle;
tbm_error_e error;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), (tbm_bo_handle) NULL);
if (!_tbm_bo_lock(bo, device, opt)) {
TBM_ERR("error: fail to lock bo:%p)\n", bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return (tbm_bo_handle) NULL;
}
_tbm_set_last_result(error);
TBM_ERR("error: fail to map bo:%p error:%d\n", bo, error);
_tbm_bo_unlock(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return (tbm_bo_handle) NULL;
/* LCOV_EXCL_STOP */
}
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
TBM_ERR("error: fail to map bo:%p\n", bo);
_tbm_bo_unlock(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return (tbm_bo_handle) NULL;
/* LCOV_EXCL_STOP */
}
TBM_TRACE_BO("bo(%p) map_cnt(%d)\n", bo, bo->map_cnt);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo_handle;
}
int ret = 1;
tbm_error_e error;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
TBM_ERR("error: bo(%p) map_cnt(%d) error(%d)\n", bo, bo->map_cnt, error);
_tbm_set_last_result(error);
ret = 0;
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return ret;
/* LCOV_EXCL_STOP */
}
/* LCOV_EXCL_START */
TBM_ERR("error: bo(%p) map_cnt(%d)\n", bo, bo->map_cnt);
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return ret;
/* LCOV_EXCL_STOP */
}
_tbm_bo_unlock(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return ret;
}
tbm_bo_handle bo_handle;
tbm_error_e error;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), (tbm_bo_handle) NULL);
/* LCOV_EXCL_START */
TBM_ERR("error: bo(%p) bo_handle(%p) error(%d)\n", bo, bo_handle.ptr, error);
_tbm_set_last_result(error);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return (tbm_bo_handle) NULL;
/* LCOV_EXCL_STOP */
}
/* LCOV_EXCL_START */
TBM_ERR("error: bo(%p) bo_handle(%p)\n", bo, bo_handle.ptr);
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return (tbm_bo_handle) NULL;
/* LCOV_EXCL_STOP */
}
TBM_TRACE_BO("bo(%p) bo_handle(%p)\n", bo, bo_handle.ptr);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo_handle;
}
tbm_key ret;
tbm_error_e error;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
if (bo->bufmgr->backend_module_data) {
if (!bo->bufmgr->bo_func->bo_export_key) {
/* LCOV_EXCL_START */
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
_tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
return 0;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
TBM_ERR("error: bo(%p) tbm_key(%d) error(%d)\n", bo, ret, error);
_tbm_set_last_result(error);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return ret;
/* LCOV_EXCL_STOP */
}
} else {
if (!bo->bufmgr->backend->bo_export) {
/* LCOV_EXCL_START */
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
_tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
return 0;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
TBM_ERR("error: bo(%p) tbm_key(%d)\n", bo, ret);
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return ret;
/* LCOV_EXCL_STOP */
}
TBM_TRACE_BO("bo(%p) tbm_key(%u)\n", bo, ret);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return ret;
}
tbm_fd ret;
tbm_error_e error;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), -1);
if (bo->bufmgr->backend_module_data) {
if (!bo->bufmgr->bo_func->bo_export_fd) {
/* LCOV_EXCL_START */
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
_tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
return -1;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
TBM_ERR("error: bo(%p) tbm_fd(%d) error(%d)\n", bo, ret, error);
_tbm_set_last_result(error);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return ret;
/* LCOV_EXCL_STOP */
}
} else {
if (!bo->bufmgr->backend->bo_export_fd) {
/* LCOV_EXCL_START */
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
_tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
return -1;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
TBM_ERR("error: bo(%p) tbm_fd(%d)\n", bo, ret);
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return ret;
/* LCOV_EXCL_STOP */
}
TBM_TRACE_BO("bo(%p) tbm_fd(%d)\n", bo, ret);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return ret;
}
tbm_error_e error;
tbm_backend_bo_data *bo_data;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(TBM_BUFMGR_IS_VALID(bufmgr), NULL);
if (bufmgr->backend_module_data) {
if (!bufmgr->bufmgr_func->bufmgr_import_key) {
/* LCOV_EXCL_START */
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
_tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
return NULL;
/* LCOV_EXCL_STOP */
} else {
if (!bufmgr->backend->bo_import) {
/* LCOV_EXCL_START */
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
_tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
return NULL;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
TBM_ERR("error: fail to import of tbm_bo by key(%d)\n", key);
_tbm_set_last_result(TBM_ERROR_OUT_OF_MEMORY);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return NULL;
/* LCOV_EXCL_STOP */
}
TBM_ERR("error: fail to import of tbm_bo by key(%d). error(%d)\n", key, error);
_tbm_set_last_result(error);
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return NULL;
/* LCOV_EXCL_STOP */
}
_tbm_flag_to_str(bo2->flags));
bo2->ref_cnt++;
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo2;
}
}
TBM_ERR("error: fail to import of tbm_bo by key(%d)\n", key);
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return NULL;
/* LCOV_EXCL_STOP */
}
_tbm_flag_to_str(bo2->flags));
bo2->ref_cnt++;
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo2;
}
}
LIST_ADD(&bo->item_link, &bo->bufmgr->bo_list);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo;
}
tbm_backend_bo_data *bo_data;
tbm_error_e error;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(TBM_BUFMGR_IS_VALID(bufmgr), NULL);
if (bufmgr->backend_module_data) {
if (!bufmgr->bufmgr_func->bufmgr_import_fd) {
/* LCOV_EXCL_START */
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
_tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
return NULL;
/* LCOV_EXCL_STOP */
} else {
if (!bufmgr->backend->bo_import_fd) {
/* LCOV_EXCL_START */
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
_tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
return NULL;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
TBM_ERR("error: fail to import tbm_bo by tbm_fd(%d)\n", fd);
_tbm_set_last_result(TBM_ERROR_OUT_OF_MEMORY);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return NULL;
/* LCOV_EXCL_STOP */
}
TBM_ERR("error: fail to import tbm_bo by tbm_fd(%d). error(%d)\n", fd, error);
_tbm_set_last_result(error);
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return NULL;
/* LCOV_EXCL_STOP */
}
_tbm_flag_to_str(bo2->flags));
bo2->ref_cnt++;
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo2;
}
}
TBM_ERR("error: fail to import tbm_bo by tbm_fd(%d)\n", fd);
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return NULL;
/* LCOV_EXCL_STOP */
}
_tbm_flag_to_str(bo2->flags));
bo2->ref_cnt++;
free(bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo2;
}
}
LIST_ADD(&bo->item_link, &bo->bufmgr->bo_list);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return bo;
}
int size;
tbm_error_e error;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
TBM_TRACE_BO("bo(%p) size(%d)\n", bo, size);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return size;
}
int
tbm_bo_locked(tbm_bo bo)
{
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
if (bo->bufmgr->bo_lock_type == TBM_BUFMGR_BO_LOCK_TYPE_NEVER) {
TBM_ERR("bo(%p) lock_cnt(%d)\n", bo, bo->lock_cnt);
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
if (bo->lock_cnt > 0) {
TBM_TRACE_BO("error: bo(%p) lock_cnt(%d)\n", bo, bo->lock_cnt);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 1;
}
TBM_TRACE_BO("bo(%p) lock_cnt(%d)\n", bo, bo->lock_cnt);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
int size1 = -1, size2 = -2;
void *temp;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo1), 0);
bo1->priv = bo2->priv;
bo2->priv = temp;
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 1;
fail:
TBM_ERR("error: bo1(%p) bo2(%p)\n", bo1, bo2);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
{
tbm_user_data *data;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
if (data) {
TBM_TRACE_BO("warning: user data already exist key(%ld)\n", key);
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
if (!data) {
TBM_ERR("error: bo(%p) key(%lu)\n", bo, key);
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
LIST_ADD(&data->item_link, &bo->user_data_list);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 1;
}
{
tbm_user_data *old_data;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
if (LIST_IS_EMPTY(&bo->user_data_list)) {
TBM_TRACE_BO("bo(%p) key(%lu)\n", bo, key);
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
if (!old_data) {
TBM_TRACE_BO("bo(%p) key(%lu)\n", bo, key);
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
user_data_delete(old_data);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 1;
}
{
tbm_user_data *old_data;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
if (LIST_IS_EMPTY(&bo->user_data_list)) {
TBM_TRACE_BO("error: bo(%p) key(%lu)\n", bo, key);
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
if (!old_data) {
TBM_TRACE_BO("error: bo(%p) key(%lu)\n", bo, key);
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
TBM_TRACE_BO("bo(%p) key(%lu) data(%p)\n", bo, key, old_data->data);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 1;
}
{
tbm_user_data *old_data;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
_tbm_set_last_result(TBM_ERROR_NONE);
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
if (!data || LIST_IS_EMPTY(&bo->user_data_list)) {
TBM_TRACE_BO("error: bo(%p) key(%lu)\n", bo, key);
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
*data = NULL;
TBM_TRACE_BO("error: bo(%p) key(%lu)\n", bo, key);
_tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 0;
}
TBM_TRACE_BO("bo(%p) key(%lu) data(%p)\n", bo, key, old_data->data);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 1;
}
{
int flags;
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
TBM_TRACE_BO("bo(%p)\n", bo);
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return flags;
}
int
_tbm_bo_set_surface(tbm_bo bo, tbm_surface_h surface)
{
- _tbm_bo_mutex_lock();
+ _tbm_bufmgr_mutex_lock();
TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
bo->surface = surface;
- _tbm_bo_mutex_unlock();
+ _tbm_bufmgr_mutex_unlock();
return 1;
}