This fixes #886 by releasing the monitor of ACTIVE_DOWNLOADS (through Object#wait) when waiting on a concurrent download. Whenever a download finishes, all waiting threads will be notified and check whether the download they are currently waiting on has completed. If that is the case, the result is returned. If not, the thread invokes Object#wait again and waits for the next download to complete.
This fixes #886 by releasing the monitor of
ACTIVE_DOWNLOADS
(throughObject#wait
) when waiting on a concurrent download. Whenever a download finishes, all waiting threads will be notified and check whether the download they are currently waiting on has completed. If that is the case, the result is returned. If not, the thread invokesObject#wait
again and waits for the next download to complete.