소스 검색

Reset number of timers if timer thread exits

bel 8 년 전
부모
커밋
5ff7711126
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/timer.inl

+ 2 - 0
src/timer.inl

@@ -129,6 +129,7 @@ timer_thread_run(void *thread_func_param)
 		clock_gettime(CLOCK_MONOTONIC, &now);
 		d = (double)now.tv_sec + (double)now.tv_nsec * 1.0E-9;
 	}
+    ctx->timers->timer_count = 0;
 #endif
 }
 
@@ -166,6 +167,7 @@ static void
 timers_exit(struct mg_context *ctx)
 {
 	if (ctx->timers) {
+        ctx->timers->timer_count = 0;
 		(void)pthread_mutex_destroy(&ctx->timers->mutex);
 		mg_free(ctx->timers);
 	}