Browse Source

deps-libff: Abort timer thread instead of cancelling

John Bradley 10 years ago
parent
commit
47783f26c7
1 changed files with 5 additions and 1 deletions
  1. 5 1
      deps/libff/libff/ff-timer.c

+ 5 - 1
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);