From 3549c26f6ce79a5bcf3ee11b897f9262408f53ba Mon Sep 17 00:00:00 2001 From: Kitae Kim Date: Tue, 21 Jan 2014 20:20:25 +0900 Subject: [PATCH] brillcodec: remove concurrent data access violation case. Although the data is not accessed by multi-threads logically, it has to be covered with lock mechanism. Change-Id: Ica3c196b6522a4b371e3fcdd39a92674b0d9ee43 Signed-off-by: Kitae Kim --- tizen/src/hw/maru_brill_codec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tizen/src/hw/maru_brill_codec.c b/tizen/src/hw/maru_brill_codec.c index 702fefa84a..a76bd93ff1 100644 --- a/tizen/src/hw/maru_brill_codec.c +++ b/tizen/src/hw/maru_brill_codec.c @@ -88,7 +88,6 @@ typedef struct PixFmtInfo { static PixFmtInfo pix_fmt_info[PIX_FMT_NB]; // thread -// static int idle_thread_cnt = 0; #define DEFAULT_WORKER_THREAD_CNT 8 static void *maru_brill_codec_threads(void *opaque); @@ -162,7 +161,10 @@ static void maru_brill_codec_threads_create(MaruBrillCodecState *s) qemu_mutex_init(&s->threadpool.mutex); s->is_thread_running = true; + + qemu_mutex_lock(&s->context_mutex); s->idle_thread_cnt = 0; + qemu_mutex_unlock(&s->context_mutex); for (index = 0; index < s->worker_thread_cnt; index++) { qemu_thread_create(&pthread[index], @@ -1723,8 +1725,6 @@ static int maru_brill_codec_initfn(PCIDevice *dev) pci_register_bar(&s->dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->vram); pci_register_bar(&s->dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mmio); -// maru_brill_codec_reset(&s->dev.qdev); - qemu_mutex_init(&s->context_mutex); qemu_mutex_init(&s->context_queue_mutex); qemu_mutex_init(&s->ioparam_queue_mutex); -- 2.34.1