()
| 35 | } |
| 36 | |
| 37 | func (q *jobQueue) Pop() (string, bool) { |
| 38 | q.mut.Lock() |
| 39 | defer q.mut.Unlock() |
| 40 | |
| 41 | if len(q.queued) == 0 { |
| 42 | return "", false |
| 43 | } |
| 44 | |
| 45 | f := q.queued[0].name |
| 46 | q.queued = q.queued[1:] |
| 47 | q.progress = append(q.progress, f) |
| 48 | |
| 49 | return f, true |
| 50 | } |
| 51 | |
| 52 | func (q *jobQueue) BringToFront(filename string) { |
| 53 | q.mut.Lock() |