()
| 1 | package task |
| 2 | |
| 3 | func (e *Executor) acquireConcurrencyLimit() func() { |
| 4 | if e.concurrencySemaphore == nil { |
| 5 | return emptyFunc |
| 6 | } |
| 7 | |
| 8 | e.concurrencySemaphore <- struct{}{} |
| 9 | return func() { |
| 10 | <-e.concurrencySemaphore |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | func (e *Executor) releaseConcurrencyLimit() func() { |
| 15 | if e.concurrencySemaphore == nil { |