From 47783f26c726595997876007a5e6de7df9967c11 Mon Sep 17 00:00:00 2001 From: John Bradley Date: Thu, 12 Mar 2015 15:16:55 -0500 Subject: [PATCH] deps-libff: Abort timer thread instead of cancelling --- deps/libff/libff/ff-timer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deps/libff/libff/ff-timer.c b/deps/libff/libff/ff-timer.c index a7ddc1bea..61064ca2e 100644 --- a/deps/libff/libff/ff-timer.c +++ b/deps/libff/libff/ff-timer.c @@ -99,7 +99,11 @@ void ff_timer_free(struct ff_timer *timer) assert(timer != NULL); - pthread_cancel(timer->timer_thread); + pthread_mutex_lock(&timer->mutex); + timer->abort = true; + pthread_cond_signal(&timer->cond); + pthread_mutex_unlock(&timer->mutex); + pthread_join(timer->timer_thread, &thread_result); pthread_mutex_destroy(&timer->mutex);