when vibrating buffer finished normally, it doesn't notify to system-server. tizen_2.1 accepted/tizen/20130520.101230 submit/tizen/20130517.045149 submit/tizen_2.1/20130514.052805
authorjy910.yun <jy910.yun@samsung.com>
Fri, 26 Apr 2013 07:05:10 +0000 (16:05 +0900)
committerjy910.yun <jy910.yun@samsung.com>
Fri, 26 Apr 2013 08:19:30 +0000 (17:19 +0900)
Also stop value has been wrong operation.

Change-Id: Ie860c2516144fd9bc40af5e6ef5836dcb0d71f0a

tizen/DEVICE/src/file.c

index eea51e8..b640e0c 100644 (file)
@@ -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);
 }