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:
parent
2531b26acf
commit
fcab905eca
3 changed files with 3 additions and 3 deletions
|
@ -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 ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue