From: Kitae Kim Date: Tue, 21 Jan 2014 11:20:25 +0000 (+0900) Subject: brillcodec: remove concurrent data access violation case. X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~497^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F18%2F16218%2F1;p=sdk%2Femulator%2Fqemu.git 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 --- 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);