{
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;
}
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);
__call_app_result_callback(kb, 1, launched_pid);
break;
}
- pthread_mutex_unlock(&result_lock);
+
return 0;
}