From: jy910.yun Date: Fri, 26 Apr 2013 07:05:10 +0000 (+0900) Subject: when vibrating buffer finished normally, it doesn't notify to system-server. X-Git-Tag: accepted/tizen/20130520.101230^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fsystem%2Fhaptic-module-tizen.git;a=commitdiff_plain;h=474a30caac537cd3f34fd215054a7c90f8d77773 when vibrating buffer finished normally, it doesn't notify to system-server. Also stop value has been wrong operation. Change-Id: Ie860c2516144fd9bc40af5e6ef5836dcb0d71f0a --- diff --git a/tizen/DEVICE/src/file.c b/tizen/DEVICE/src/file.c index eea51e8..b640e0c 100644 --- a/tizen/DEVICE/src/file.c +++ b/tizen/DEVICE/src/file.c @@ -130,11 +130,12 @@ static int _cancel_thread(void) } if (pthread_join(tid, (void**)&ptr) < 0) { - tid = 0; MODULE_ERROR("pthread_join is failed : %s", strerror(errno)); return -1; } + stop = 0; + tid = 0; if (ptr == PTHREAD_CANCELED) { MODULE_LOG("pthread canceled"); @@ -152,8 +153,6 @@ static void __clean_up(void *arg) MODULE_LOG("clean up handler!!! : %d", tid); - stop = 0; - for (i = 0; i < pbuffer->channels; ++i) { free(pbuffer->ppbuffer[i]); pbuffer->ppbuffer[i] = NULL; @@ -197,6 +196,10 @@ static void* __play_cb(void *arg) } } + pthread_mutex_lock(&mutex); + __haptic_predefine_action(gbuffer.handle, STOP, NULL); + pthread_mutex_unlock(&mutex); + pthread_cleanup_pop(1); pthread_exit((void *)0); }