unlock mutex before unref a buffer 72/81372/1
authorBoram Park <boram1288.park@samsung.com>
Mon, 25 Jul 2016 23:53:46 +0000 (08:53 +0900)
committerBoram Park <boram1288.park@samsung.com>
Mon, 25 Jul 2016 23:54:18 +0000 (08:54 +0900)
The frontend user release handler can be called when tdm_buffer_unref_backend
is called. We have to unlock/lock the mutex before/after calling
tdm_buffer_unref_backend function.

Change-Id: Idd97a9286c9d7083d5a77ec23595686a81b61d8e

src/tdm_pp.c

index dab6529..a87ac19 100644 (file)
@@ -441,8 +441,10 @@ tdm_pp_commit(tdm_pp *pp)
                        tdm_buffer_remove_release_handler_internal(b->src);
                        tdm_buffer_remove_release_handler_internal(b->dst);
 
+                       _pthread_mutex_unlock(&private_display->lock);
                        tdm_buffer_unref_backend(b->src);
                        tdm_buffer_unref_backend(b->dst);
+                       _pthread_mutex_lock(&private_display->lock);
                        LIST_DEL(&b->link);
                }
        }