From: Vineet Uprari Date: Fri, 13 Sep 2013 09:48:31 +0000 (+0530) Subject: Fixed continuous vibration along with system hang. X-Git-Tag: accepted/tizen/common/20140923.084900~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26125a353ea1e09bccc4193d9168aaef230a72cf;p=platform%2Fcore%2Fsystem%2Fhaptic-module-tizen.git Fixed continuous vibration along with system hang. Change-Id: I9afb037601cb814b74d91bbb28ee7337b59e4548 --- diff --git a/tizen/DEVICE/src/file.c b/tizen/DEVICE/src/file.c index b640e0c..1a6ae80 100644 --- a/tizen/DEVICE/src/file.c +++ b/tizen/DEVICE/src/file.c @@ -121,7 +121,7 @@ static int _cancel_thread(void) usleep(100); MODULE_LOG("Already locked.."); } - __haptic_predefine_action(gbuffer.handle, STOP, NULL); + pthread_mutex_unlock(&mutex); if ((ret = pthread_cancel(tid)) < 0) { @@ -163,6 +163,11 @@ static void __clean_up(void *arg) pbuffer->channels = 0; pbuffer->length = 0; + + if(stop){ + __haptic_predefine_action(gbuffer.handle, STOP, NULL); + pthread_mutex_unlock(&mutex); + } } static void* __play_cb(void *arg) @@ -182,7 +187,6 @@ static void* __play_cb(void *arg) for (k = 0; k < pbuffer->channels; ++k) { pthread_mutex_lock(&mutex); if (stop) { - pthread_mutex_unlock(&mutex); pthread_exit((void*)0); } ch = pbuffer->ppbuffer[k][j];