Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace timer with monotonic time in gproc_pool (#195)
I have often observed stray timeout messages even after modifying clear_wait/1 to flush out these messages like so: clear_wait(nowait) -> ok; clear_wait({busy_wait, Ref}) -> erlang:cancel_timer(Ref), receive {timeout, Ref, _} -> ok after 0 -> ok end. The documentation of erlang:cancel_timer/2 has this to say: ...Even if the timer had expired, it does not tell you if the time-out message has arrived at its destination yet. That means getting rid of unwanted timeout messages is racy and expensive. In this change monotonic time is used to detect timeout which avoids this problem.
- Loading branch information