(d domain)
| 379 | } |
| 380 | |
| 381 | func (*Acquirer) clearOrPendLocked(d domain) { |
| 382 | // MUST BE CALLED HOLDING THE a.mu LOCK |
| 383 | var nominee *acquiree |
| 384 | for _, w := range d.acquirees { |
| 385 | if nominee == nil { |
| 386 | nominee = w |
| 387 | } |
| 388 | // acquiree in progress always takes precedence, since we don't want to |
| 389 | // wake up more than one acquiree per dKey at a time. |
| 390 | if w.inProgress { |
| 391 | nominee = w |
| 392 | break |
| 393 | } |
| 394 | } |
| 395 | if nominee.inProgress { |
| 396 | nominee.pending = true |
| 397 | return |
| 398 | } |
| 399 | nominee.inProgress = true |
| 400 | nominee.clearance <- struct{}{} |
| 401 | } |
| 402 | |
| 403 | type dKey string |
| 404 |
no outgoing calls
no test coverage detected