Bläddra i källkod

Join timer thread in timers_exit (#431)

extergnoto 8 år sedan
förälder
incheckning
628b57171d
1 ändrade filer med 3 tillägg och 0 borttagningar
  1. 3 0
      src/timer.inl

+ 3 - 0
src/timer.inl

@@ -210,6 +210,9 @@ timers_exit(struct mg_context *ctx)
 	if (ctx->timers) {
 	if (ctx->timers) {
 		pthread_mutex_lock(&ctx->timers->mutex);
 		pthread_mutex_lock(&ctx->timers->mutex);
 		ctx->timers->timer_count = 0;
 		ctx->timers->timer_count = 0;
+
+		mg_join_thread(ctx->timers->threadid);
+
 		/* TODO: Do we really need to unlock the mutex, before
 		/* TODO: Do we really need to unlock the mutex, before
 		 * destroying it, if it's destroyed by the thread currently
 		 * destroying it, if it's destroyed by the thread currently
 		 * owning the mutex? */
 		 * owning the mutex? */