lock locks the controller's mutex, unless ctx belongs to a reconciler invocation that already holds the lock (by having called c.Lock).
(ctx context.Context, read bool)
| 904 | |
| 905 | // lock locks the controller's mutex, unless ctx belongs to a reconciler invocation that already holds the lock (by having called c.Lock). |
| 906 | func (c *Controller) lock(ctx context.Context, read bool) { |
| 907 | inv := invocationFromContext(ctx) |
| 908 | if inv != nil && inv.holdsLock { |
| 909 | return |
| 910 | } |
| 911 | if read { |
| 912 | c.mu.RLock() |
| 913 | } else { |
| 914 | c.mu.Lock() |
| 915 | } |
| 916 | } |
| 917 | |
| 918 | // unlock unlocks the controller's mutex, unless ctx belongs to a reconciler invocation that holds the lock (by having called c.Lock). |
| 919 | func (c *Controller) unlock(ctx context.Context, read bool) { |
no test coverage detected