summaryrefslogtreecommitdiff
path: root/provider/download-provider-notification-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'provider/download-provider-notification-manager.c')
-rw-r--r--provider/download-provider-notification-manager.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/provider/download-provider-notification-manager.c b/provider/download-provider-notification-manager.c
index ea89c0c..d4f8b8f 100644
--- a/provider/download-provider-notification-manager.c
+++ b/provider/download-provider-notification-manager.c
@@ -515,7 +515,7 @@ static int __dp_notification_manager_start()
TRACE_DEBUG("try to create notification-manager");
if (pthread_create(&g_dp_notification_manager_tid, NULL,
__dp_notification_manager, NULL) != 0) {
- TRACE_STRERROR("failed to create notification-manager");
+ TRACE_ERROR("failed to create notification-manager");
return -1;
}
}
@@ -540,13 +540,15 @@ void dp_notification_manager_kill()
if (g_dp_notification_manager_tid > 0 &&
pthread_kill(g_dp_notification_manager_tid, 0) != ESRCH) {
//send signal to notification thread
- g_dp_notification_manager_tid = 0;
+ int status;
+ pthread_t tid;
+ tid = g_dp_notification_manager_tid;
CLIENT_MUTEX_LOCK(&g_dp_notification_manager_mutex);
+ g_dp_notification_manager_tid = 0;
pthread_cond_signal(&g_dp_notification_manager_cond);
CLIENT_MUTEX_UNLOCK(&g_dp_notification_manager_mutex);
- pthread_cancel(g_dp_notification_manager_tid);
- int status;
- pthread_join(g_dp_notification_manager_tid, (void **)&status);
+ pthread_cancel(tid);
+ pthread_join(tid, (void **)&status);
}
}
#else