lock before map and unlock after unmap 20/18020/1 accepted/tizen_generic devel/x11 tizen_3.0.m14.2_ivi accepted/tizen/generic/20140415.103911 accepted/tizen/ivi/20140410.192424 accepted/tizen/mobile/20140702.071654 submit/devel/x11/20140718.035926 submit/tizen/20140409.005132 tizen_3.0.m14.2_ivi_release
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 14 Aug 2013 02:05:03 +0000 (11:05 +0900)
committerBoram Park <boram1288.park@samsung.com>
Fri, 14 Mar 2014 04:52:49 +0000 (13:52 +0900)
Change-Id: If81c5083f345d6bdeac0d9d33cd2e861ab885318

packaging/libtbm.spec
src/tbm_bufmgr.c

index 0c8dbc6..7567a07 100644 (file)
@@ -1,6 +1,6 @@
 Name:           libtbm
 Version:        1.0.6
-Release:        4
+Release:        5
 License:        MIT
 Summary:        Tizen Buffer Manager Library
 Group:          System/Libraries
index 417ef11..3e7c3b8 100755 (executable)
@@ -1193,10 +1193,12 @@ tbm_bo_map (tbm_bo bo, int device, int opt)
 
     pthread_mutex_lock (&bufmgr->lock);
 
-    bo_handle = bufmgr->backend->bo_map (bo, device, opt);
+    bo_handle = bufmgr->backend->bo_get_handle (bo, device);
 
     _tbm_bo_lock (bo, device, opt);
 
+    bo_handle = bufmgr->backend->bo_map (bo, device, opt);
+
     if (bufmgr->use_map_cache == 1 && bo->map_cnt == 0)
         _tbm_bo_set_state (bo, device, opt);
 
@@ -1220,7 +1222,6 @@ tbm_bo_unmap (tbm_bo bo)
 
     pthread_mutex_lock (&bufmgr->lock);
 
-     _tbm_bo_unlock (bo);
 
     ret = bufmgr->backend->bo_unmap (bo);
 
@@ -1230,6 +1231,8 @@ tbm_bo_unmap (tbm_bo bo)
     if (bo->map_cnt == 0)
         _tbm_bo_save_state (bo);
 
+     _tbm_bo_unlock (bo);
+
     pthread_mutex_unlock (&bufmgr->lock);
 
     return ret;