summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjy910.yun <jy910.yun@samsung.com>2013-04-15 14:08:46 +0900
committerjy910.yun <jy910.yun@samsung.com>2013-04-15 14:12:28 +0900
commitb4159fdc374a1e85d08f316be752bba19af2ad8b (patch)
treec3e864193ef48fc55418484db9ecadb19e429a07
parentc0970715740a3f8765224399512c24daf27ae6a4 (diff)
downloadhaptic-module-tizen-b4159fdc374a1e85d08f316be752bba19af2ad8b.tar.gz
haptic-module-tizen-b4159fdc374a1e85d08f316be752bba19af2ad8b.tar.bz2
haptic-module-tizen-b4159fdc374a1e85d08f316be752bba19af2ad8b.zip
additional correction regarding haptic deadlock
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
-rw-r--r--tizen/DEVICE/src/file.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tizen/DEVICE/src/file.c b/tizen/DEVICE/src/file.c
index e3d4341..4063166 100644
--- a/tizen/DEVICE/src/file.c
+++ b/tizen/DEVICE/src/file.c
@@ -55,6 +55,7 @@ typedef struct {
static pthread_t tid;
static BUFFER gbuffer;
+static int lock;
static int _check_valid_haptic_format(HapticFile *file)
{
@@ -111,6 +112,12 @@ static int _cancel_thread(void)
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) {
@@ -170,7 +177,9 @@ static void* __play_cb(void *arg)
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);