brillcodec: Fixed deadlock problem. 27/11727/1
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 14 Oct 2013 06:40:29 +0000 (15:40 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Mon, 4 Nov 2013 05:37:13 +0000 (14:37 +0900)
This problem happened frequently on Windows and wrong use of pthread_cond_signal a cause of deadlock.
pthread_cond_wait api has to be locked by mutex when you use it.

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

index 7b276426fa01eeab6b6f1c4ac53b91b986e6a2df..b65db1daffcf69060172840a8dcbd2e57aea72d5 100644 (file)
@@ -221,7 +221,9 @@ static void maru_brill_codec_wakeup_threads(MaruBrillCodecState *s, int api_inde
     }
 
     maru_brill_codec_add_ioparam_queue(s, (void *)ioparam);
+    qemu_mutex_lock(&s->context_mutex);
     qemu_cond_signal(&s->threadpool.cond);
+    qemu_mutex_unlock(&s->context_mutex);
 }
 
 static void *maru_brill_codec_threads(void *opaque)