浏览代码

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);
 	}