lib: fix - invalid timer priority queue order
-
in lib/timers.js PriorityQueue.percolateDown cannot be used for rescheduling list, because it does not work in all cases
- updated item does not have to be root of the heap when new timers are created in runNextTicks and then percolateDown does not solve all binary heap inconsistencies
- old behavior could cause infinite loop timers in some cases
-
added PriorityQueue.updateAt and PriorityQueue.update methods
- simple implementation by remove & insert, could be improved...
- rescheduling list uses updateAt method
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines