diff options
author | Jaeho Lee <jaeho81.lee@samsung.com> | 2013-06-28 14:17:04 +0900 |
---|---|---|
committer | Jaeho Lee <jaeho81.lee@samsung.com> | 2013-06-28 14:17:04 +0900 |
commit | 3aa0c8ff48df8d67f43d196ec82d3e7ffeaf8eb9 (patch) | |
tree | f982b920f711ced70ae17fd0f2914fc5f6da9b51 | |
parent | f38175890bdd03344ffdeedc37da478bfc3fddaf (diff) | |
download | aul-1-3aa0c8ff48df8d67f43d196ec82d3e7ffeaf8eb9.tar.gz aul-1-3aa0c8ff48df8d67f43d196ec82d3e7ffeaf8eb9.tar.bz2 aul-1-3aa0c8ff48df8d67f43d196ec82d3e7ffeaf8eb9.zip |
fixed mutex lock bug
Signed-off-by: Jaeho Lee <jaeho81.lee@samsung.com>
-rw-r--r-- | packaging/aul.spec | 2 | ||||
-rwxr-xr-x | src/launch_with_result.c | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/packaging/aul.spec b/packaging/aul.spec index 20081942..c706bd87 100644 --- a/packaging/aul.spec +++ b/packaging/aul.spec @@ -1,6 +1,6 @@ Name: aul Summary: App utility library -Version: 0.0.275 +Version: 0.0.276 Release: 1 Group: System/Libraries License: Apache License, Version 2.0 diff --git a/src/launch_with_result.c b/src/launch_with_result.c index 0dc847a3..62b69047 100755 --- a/src/launch_with_result.c +++ b/src/launch_with_result.c @@ -80,12 +80,16 @@ static app_resultcb_info_t *__find_resultcb(int pid) { app_resultcb_info_t *tmp; + pthread_mutex_lock(&result_lock); tmp = rescb_head; while (tmp) { - if (tmp->launched_pid == pid) + if (tmp->launched_pid == pid) { + pthread_mutex_unlock(&result_lock); return tmp; + } tmp = tmp->next; } + pthread_mutex_unlock(&result_lock); return NULL; } @@ -246,7 +250,6 @@ int _app_start_res_prepare(bundle *kb) int app_result(int cmd, bundle *kb, int launched_pid) { - pthread_mutex_lock(&result_lock); switch (cmd) { case APP_RESULT: __call_app_result_callback(kb, 0, launched_pid); @@ -255,7 +258,7 @@ int app_result(int cmd, bundle *kb, int launched_pid) __call_app_result_callback(kb, 1, launched_pid); break; } - pthread_mutex_unlock(&result_lock); + return 0; } |