Browse Source

[Minor] Fix timer race in hs_helper

tags/2.0
Vsevolod Stakhov 4 years ago
parent
commit
e9e7ea8b37
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      src/hs_helper.c

+ 4
- 1
src/hs_helper.c View File

ctx->event_loop, &srv_cmd, -1, NULL, NULL); ctx->event_loop, &srv_cmd, -1, NULL, NULL);
ev_timer_stop (EV_A_ w); ev_timer_stop (EV_A_ w);
g_free (w); g_free (w);

ev_timer_again (EV_A_ &ctx->recompile_timer);
} }


static void static void
strerror (errno)); strerror (errno));
} }


/* Stop recompile */
ev_timer_stop (ctx->event_loop, &ctx->recompile_timer);
rspamd_rs_compile (ctx, worker, TRUE); rspamd_rs_compile (ctx, worker, TRUE);


return TRUE; return TRUE;
tim = rspamd_time_jitter (ctx->recompile_time, 0); tim = rspamd_time_jitter (ctx->recompile_time, 0);
w->repeat = tim; w->repeat = tim;
rspamd_rs_compile (ctx, worker, FALSE); rspamd_rs_compile (ctx, worker, FALSE);
ev_timer_again (EV_A_ w);
} }


static void static void

Loading…
Cancel
Save