when adding callback, it prepends the list
but when finding callback, the first matching callback is called (LIFO)
it should be FIFO
Change-Id: Ied1d71b13be6e572c259eea08d29e59200ddf7bd
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
static app_resultcb_info_t *__find_resultcb(int pid)
{
app_resultcb_info_t *tmp;
+ app_resultcb_info_t *ret = NULL;
pthread_mutex_lock(&result_lock);
tmp = rescb_head;
while (tmp) {
- if (tmp->launched_pid == pid) {
- pthread_mutex_unlock(&result_lock);
- return tmp;
- }
+ if (tmp->launched_pid == pid)
+ ret = tmp;
tmp = tmp->next;
}
pthread_mutex_unlock(&result_lock);
- return NULL;
+
+ return ret;
}
static void __remove_resultcb(app_resultcb_info_t *info)