eth, eth/downloader: make synchronize thread safe

This commit is contained in:
Péter Szilágyi
2015-05-07 21:07:20 +03:00
parent 43901c9282
commit 9d188f73b5
5 changed files with 22 additions and 82 deletions

View File

@ -63,16 +63,6 @@ func (q *queue) Reset() {
q.blockCache = nil
}
// Done checks if all the downloads have been retrieved, wiping the queue.
func (q *queue) Done() {
q.lock.Lock()
defer q.lock.Unlock()
if len(q.blockCache) == 0 {
q.Reset()
}
}
// Size retrieves the number of hashes in the queue, returning separately for
// pending and already downloaded.
func (q *queue) Size() (int, int) {