diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 58b82a4ad8..2c3b210c9b 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -2231,8 +2231,9 @@ static void *process_clearcache(void *ignore) int striplen = sizeof("/dundi/cache"); time_t now; + pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL); while (!dundi_shutdown) { - pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL); + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); time(&now); @@ -2249,7 +2250,7 @@ static void *process_clearcache(void *ignore) } ast_db_freetree(db_tree); - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_testcancel(); sleep(60); pthread_testcancel();