MCPcopy Index your code
hub / github.com/tailscale/tailscale / run

Method run

util/execqueue/execqueue.go:60–79  ·  view source on GitHub ↗
(f func())

Source from the content-addressed store, hash-verified

58}
59
60func (q *ExecQueue) run(f func()) {
61 f()
62
63 q.mu.Lock()
64 for len(q.queue) > 0 && !q.closed {
65 f := q.queue[0]
66 q.queue[0] = nil
67 q.queue = q.queue[1:]
68 q.mu.Unlock()
69 f()
70 q.mu.Lock()
71 }
72 q.inFlight = false
73 q.queue = nil
74 if q.doneWaiter != nil {
75 close(q.doneWaiter)
76 q.doneWaiter = nil
77 }
78 q.mu.Unlock()
79}
80
81// Shutdown asynchronously signals the queue to stop.
82func (q *ExecQueue) Shutdown() {

Callers 1

AddMethod · 0.95

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected