luci: go.chromium.org/luci/mmutex/lib Index | Files

package lib

import "go.chromium.org/luci/mmutex/lib"

Index

Package Files

exclusive.go lock_file_helpers.go shared.go

Constants

const DefaultCommandTimeout = 2 * time.Hour

DefaultCommandTimeout is the total amount of time, including lock acquisition and command runtime, allotted to running a command through mmutex.

const DrainFileName = "mmutex.drain"

DrainFileName specifies the name of the drain file within $MMUTEX_LOCK_DIR.

const LockFileEnvVariable = "MMUTEX_LOCK_DIR"

LockFileEnvVariable specifies the directory of the lock file.

const LockFileName = "mmutex.lock"

LockFileName specifies the name of the lock file within $MMUTEX_LOCK_DIR.

func RemoveDrainFile Uses

func RemoveDrainFile(ctx context.Context, drainFilePath string)

func RunExclusive Uses

func RunExclusive(ctx context.Context, env subcommands.Env, command func(context.Context) error) error

RunExclusive runs the command with the specified context and environment while holding an exclusive mmutex lock.

func RunShared Uses

func RunShared(ctx context.Context, env subcommands.Env, command func(context.Context) error) error

RunShared runs the command with the specified context and environment while holding a shared mmutex lock.

Package lib imports 10 packages (graph) and is imported by 1 packages. Updated 2020-07-08. Refresh now. Tools for package owners.