brillcodec: improved performance. 28/11728/1
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 14 Oct 2013 07:43:46 +0000 (16:43 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Mon, 4 Nov 2013 05:37:59 +0000 (14:37 +0900)
Reduced synchronizing areas.

Change-Id: I82e8bd50f2a9a75c6442708d1df3e4577cd5ee91
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
tizen/src/hw/maru_brill_codec.c

index b65db1daffcf69060172840a8dcbd2e57aea72d5..7c2e9a6ebc4e2114ac55f5917b5e632c0656aed8 100644 (file)
@@ -232,12 +232,13 @@ static void *maru_brill_codec_threads(void *opaque)
 
     TRACE("enter: %s\n", __func__);
 
-    qemu_mutex_lock(&s->context_mutex);
     while (s->is_thread_running) {
         int ctx_id, f_id, api_id;
         CodecParamStg *elem = NULL;
 
+        qemu_mutex_lock(&s->context_mutex);
         qemu_cond_wait(&s->threadpool.cond, &s->context_mutex);
+        qemu_mutex_unlock(&s->context_mutex);
 
         qemu_mutex_lock(&s->ioparam_queue_mutex);
         elem = QTAILQ_FIRST(&ioparam_queue);
@@ -280,7 +281,6 @@ static void *maru_brill_codec_threads(void *opaque)
 //            qemu_mutex_unlock(&s->threadpool.mutex);
         }
     }
-    qemu_mutex_unlock(&s->context_mutex);
 
     maru_brill_codec_thread_exit(s);