From 1ce8fa3b9a6e87b46e7e4c81426f69a41b804e1b Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Mon, 11 Nov 2013 17:46:52 +0900 Subject: [PATCH] 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 --- tizen/src/hw/maru_virtio_touchscreen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); -- 2.34.1