erlang/otp — pull request #327 by Etsukata (2014-04-10 12:12:28+00:00)
Title: Add erlang:statistic(async_queue) to get the queue length of async queue

Add erlang:statistic(async_queue) and erlang:statistics(async_queues).

erlang:statistics(async_queue) returns the total length of the
async queues, that is, the number of asynchronous works that are ready to run on
all async queues like erlang:statistics(run_queue).

Previous pull request: #295

Updates:
* rebased to the latest master.
* delays deallocation of elements in lock-free queue by using reference counter while counting.
* delays finalize_dequeue by setting max operation count to zero while the reference count is greater than 0.