MCPcopy Create free account
hub / github.com/coder/coder / clearOrPendLocked

Method clearOrPendLocked

coderd/provisionerdserver/acquirer.go:381–401  ·  view source on GitHub ↗
(d domain)

Source from the content-addressed store, hash-verified

379}
380
381func (*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
403type dKey string
404

Callers 3

jobPostedMethod · 0.95
clearOrPendAllMethod · 0.95
clearOrPendMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected