pthread_cancel may lead unpredictable thread synchronization problem
when it is not used properly.
pthread_cancel in notification manager may lead deadlock because
it terminates __dp_notification_manager thread asynchronously.
refer to https://www.securecoding.cert.org/confluence/display/c/POS47-C.+Do+not+use+threads+that+can+be+canceled+asynchronously
Change-Id: I39c00a882df5cfede647e0d456c03eeb57c8971e
Signed-off-by: Semun Lee <semun.lee@samsung.com>
g_dp_notification_manager_tid = 0;
pthread_cond_signal(&g_dp_notification_manager_cond);
CLIENT_MUTEX_UNLOCK(&g_dp_notification_manager_mutex);
- pthread_cancel(tid);
pthread_join(tid, (void **)&status);
}
}