0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Cancel timers async

Where it wasn't already async. To slightly improve performance.
This commit is contained in:
David Ansari 2024-04-11 15:26:23 +02:00 committed by Loïc Hoguin
parent 2531b26acf
commit fcab905eca
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
3 changed files with 3 additions and 3 deletions

View file

@ -328,7 +328,7 @@ cancel_timeout(State=#state{timer=TimerRef}) ->
_ ->
%% Do a synchronous cancel and remove the message if any
%% to avoid receiving stray messages.
_ = erlang:cancel_timer(TimerRef),
_ = erlang:cancel_timer(TimerRef, [{async, false}, {info, false}]),
receive
{timeout, TimerRef, _} -> ok
after 0 ->