From: GiWoong Kim Date: Mon, 11 Nov 2013 08:46:52 +0000 (+0900) Subject: touch: remove data race condition X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~607^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ce8fa3b9a6e87b46e7e4c81426f69a41b804e1b;p=sdk%2Femulator%2Fqemu.git touch: remove data race condition There is no need to reset the ring buffer counter in the pthread lock section. Change-Id: I86f46a5ff5c38fc57e9f6d58b4d49f8905c5c648 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/hw/maru_virtio_touchscreen.c b/tizen/src/hw/maru_virtio_touchscreen.c index e197319436..816bf1ef97 100644 --- a/tizen/src/hw/maru_virtio_touchscreen.c +++ b/tizen/src/hw/maru_virtio_touchscreen.c @@ -319,11 +319,14 @@ static int virtio_touchscreen_device_init(VirtIODevice *vdev) /* reset the counters */ pthread_mutex_lock(&event_mutex); - event_queue_cnt = event_ringbuf_cnt = 0; + event_queue_cnt = 0; pthread_mutex_unlock(&event_mutex); + event_ringbuf_cnt = 0; + elem_ringbuf_cnt = 0; + pthread_mutex_lock(&elem_mutex); - elem_queue_cnt = elem_ringbuf_cnt = 0; + elem_queue_cnt = 0; ts->waitBuf = false; pthread_mutex_unlock(&elem_mutex);