Fix deadlock problem 96/89796/1 accepted/tizen/ivi/20160927.081044 accepted/tizen/mobile/20160927.082718 accepted/tizen/tv/20160927.083529 accepted/tizen/wearable/20160927.081850 submit/tizen/20160926.083253
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 27 Sep 2016 05:22:40 +0000 (14:22 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 27 Sep 2016 05:27:38 +0000 (14:27 +0900)
Change-Id: I64345d042d399586f85b8e29a4675b22467ea008

src/tbm_bufmgr.c
src/tbm_surface_internal.c

index 054b5d5..99721a8 100644 (file)
@@ -1445,10 +1445,13 @@ tbm_bufmgr_debug_show(tbm_bufmgr bufmgr)
        char data[255] = {0,};
        tbm_surface_debug_data *debug_old_data = NULL, *debug_tmp = NULL;
 
-       _tbm_bufmgr_mutex_lock();
+       pthread_mutex_lock(&gLock);
 
-       TBM_BUFMGR_RETURN_IF_FAIL(TBM_BUFMGR_IS_VALID(bufmgr));
-       TBM_BUFMGR_RETURN_IF_FAIL(bufmgr == gBufMgr);
+       if (!TBM_BUFMGR_IS_VALID(bufmgr) || (bufmgr != gBufMgr)) {
+               TBM_LOG_E("invalid bufmgr\n");
+               pthread_mutex_unlock(&gLock);
+               return;
+       }
 
        TBM_DEBUG("\n");
        _tbm_util_get_appname_from_pid(getpid(), app_name);
@@ -1544,7 +1547,7 @@ tbm_bufmgr_debug_show(tbm_bufmgr bufmgr)
 
        TBM_DEBUG("===============================================================\n");
 
-       _tbm_bufmgr_mutex_unlock();
+       pthread_mutex_unlock(&gLock);
 }
 
 void
index 4dafc86..874f167 100644 (file)
@@ -1394,8 +1394,10 @@ _tbm_surface_internal_get_debug_data(tbm_surface_h surface, char *key)
 
        if (!LIST_IS_EMPTY(&surface->debug_data_list)) {
                LIST_FOR_EACH_ENTRY_SAFE(old_data, tmp, &surface->debug_data_list, item_link) {
-                       if (!strcmp(old_data->key, key))
+                       if (!strcmp(old_data->key, key)) {
+                               _tbm_surface_mutex_unlock();
                                return old_data->value;
+                       }
                }
        }