surface_queue: unlock mutex lock of queue when call alloc cb 84/97484/3 accepted/tizen/3.0/common/20161116.143349 accepted/tizen/3.0/ivi/20161116.021608 accepted/tizen/3.0/mobile/20161116.021445 accepted/tizen/3.0/tv/20161116.021514 accepted/tizen/3.0/wearable/20161116.021542 accepted/tizen/common/20161116.134349 accepted/tizen/ivi/20161115.233843 accepted/tizen/mobile/20161115.233732 accepted/tizen/tv/20161115.233757 accepted/tizen/wearable/20161115.233814 submit/tizen/20161115.022149 submit/tizen_3.0/20161115.021406
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 14 Nov 2016 02:38:43 +0000 (11:38 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 15 Nov 2016 00:29:48 +0000 (16:29 -0800)
Change-Id: I4f4dd4e9eecd7898cb6f602144a017bcb68bdfb4

src/tbm_surface_queue.c

index f0c907f930dad0b98a754886075ad59204304842..ea5b09e9357f2b2ab6e971c3a2a034b59eb230ff 100644 (file)
@@ -1441,9 +1441,11 @@ __tbm_queue_default_need_attach(tbm_surface_queue_h surface_queue)
                return;
 
        if (surface_queue->alloc_cb) {
+               pthread_mutex_unlock(&surface_queue->lock);
                _tbm_surf_queue_mutex_unlock();
                surface = surface_queue->alloc_cb(surface_queue, surface_queue->alloc_cb_data);
                _tbm_surf_queue_mutex_lock();
+               pthread_mutex_lock(&surface_queue->lock);
 
                if (!surface)
                        return;
@@ -1546,9 +1548,11 @@ __tbm_queue_sequence_need_attach(tbm_surface_queue_h surface_queue)
                return;
 
        if (surface_queue->alloc_cb) {
+               pthread_mutex_unlock(&surface_queue->lock);
                _tbm_surf_queue_mutex_unlock();
                surface = surface_queue->alloc_cb(surface_queue, surface_queue->alloc_cb_data);
                _tbm_surf_queue_mutex_lock();
+               pthread_mutex_lock(&surface_queue->lock);
 
                if (!surface)
                        return;