github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/worker/uniter/operation/lock.go (about)

     1  // Copyright 2014-2015 Canonical Ltd.
     2  // Copyright 2015 Cloudbase Solutions SRL
     3  // Licensed under the AGPLv3, see LICENCE file for details.
     4  
     5  package operation
     6  
     7  // DoesNotRequireMachineLock is embedded in the various operations to express whether
     8  // they need a global machine lock or not.
     9  type RequiresMachineLock struct{}
    10  
    11  // NeedsGlobalMachineLock is part of the Operation interface.
    12  // It is embedded in the various operations.
    13  func (RequiresMachineLock) NeedsGlobalMachineLock() bool { return true }
    14  func (RequiresMachineLock) ExecutionGroup() string       { return "" }
    15  
    16  // DoesNotRequireMachineLock is embedded in the various operations to express whether
    17  // they need a global machine lock or not.
    18  type DoesNotRequireMachineLock struct{}
    19  
    20  // NeedsGlobalMachineLock is part of the Operation interface.
    21  // It is embedded in the various operations.
    22  func (DoesNotRequireMachineLock) NeedsGlobalMachineLock() bool { return false }
    23  func (DoesNotRequireMachineLock) ExecutionGroup() string       { return "" }