MCPcopy Index your code
hub / github.com/rilldata/rill / lock

Method lock

runtime/controller.go:906–916  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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).
906func (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).
919func (c *Controller) unlock(ctx context.Context, read bool) {

Callers 12

GetMethod · 0.95
ListMethod · 0.95
CreateMethod · 0.95
UpdateMetaMethod · 0.95
UpdateNameMethod · 0.95
UpdateSpecMethod · 0.95
UpdateStateMethod · 0.95
UpdateErrorAndWarningMethod · 0.95
DeleteMethod · 0.95
FlushMethod · 0.95
ReconcileMethod · 0.95
CancelMethod · 0.95

Calls 3

invocationFromContextFunction · 0.85
RLockMethod · 0.80
LockMethod · 0.45

Tested by

no test coverage detected