Tests must use locking to avoid race (fixes #2394)

This commit is contained in:
Jakob Borg
2015-10-20 08:51:14 +02:00
parent 1087535d8f
commit 0f9fa9507e
3 changed files with 30 additions and 24 deletions

View File

@@ -109,6 +109,18 @@ func (q *jobQueue) Shuffle() {
}
}
func (q *jobQueue) lenQueued() int {
q.mut.Lock()
defer q.mut.Unlock()
return len(q.queued)
}
func (q *jobQueue) lenProgress() int {
q.mut.Lock()
defer q.mut.Unlock()
return len(q.progress)
}
func (q *jobQueue) SortSmallestFirst() {
q.mut.Lock()
defer q.mut.Unlock()