cause : when subthread is waiting to system server, unexpectly thread died.
then the system server cannot reply because the receiver already died.
solution : before subthread died, it must check whether the sub thread was waiting or not.
Change-Id: I5609d4ab7ffd7a1c765432b43ec8f5335e373c45
static pthread_t tid;
static BUFFER gbuffer;
+static int lock;
static int _check_valid_haptic_format(HapticFile *file)
{
return 0;
}
+ MODULE_LOG("lock state : %d", lock);
+ while (lock) {
+ usleep(100);
+ MODULE_LOG("already locked...");
+ }
+
__haptic_predefine_action(gbuffer.handle, STOP, NULL);
if ((ret = pthread_cancel(tid)) < 0) {
for (k = 0; k < pbuffer->channels; ++k) {
ch = pbuffer->ppbuffer[k][j];
if (ch != prev) {
+ lock = 1;
__haptic_predefine_action(pbuffer->handle, LEVEL, ch);
+ lock = 0;
prev = ch;
}
usleep(BITPERMS * 1000);