lock

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package lock 使用 Windows 命名 Mutex 协调同一物理 app root 的 Runtime 操作。

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrClosed 表示 Set 已开始或完成关闭。
	ErrClosed = errors.New("mutex set is closed")
	// ErrPoisoned 表示此前的 ReleaseMutex 失败使所有权不再确定。
	ErrPoisoned = errors.New("mutex set is poisoned")
)

Functions

This section is empty.

Types

type ConflictError

type ConflictError struct {
	Kind Kind
	Name string
	// contains filtered or unexported fields
}

ConflictError 描述稳定的正常互斥冲突。

func (*ConflictError) Code

func (e *ConflictError) Code() protocol.Code

Code 返回协议层冻结的冲突码。

func (*ConflictError) Error

func (e *ConflictError) Error() string

Error 返回不含 app root 路径的诊断文本。

type Kind

type Kind string

Kind 标识一把 Runtime 命名 Mutex 的用途。

const (
	// KindBackend 保证同一 app root 只有一个后端监督进程。
	KindBackend Kind = "backend"
	// KindMutation 串行化同一 app root 的受管变更。
	KindMutation Kind = "mutation"
)

func (Kind) String

func (k Kind) String() string

String 返回 Kind 的稳定文本。

func (Kind) Valid

func (k Kind) Valid() bool

Valid 报告 Kind 是否属于冻结全集。

type OperationError

type OperationError struct {
	Operation string
	Kind      Kind
	Name      string
	Cause     error
	// contains filtered or unexported fields
}

OperationError 描述一项 Windows Mutex 操作故障。

func (*OperationError) Code

func (e *OperationError) Code() protocol.Code

Code 固定返回普通 Mutex 操作故障码。

func (*OperationError) Error

func (e *OperationError) Error() string

Error 返回不含 app root 路径的诊断文本。

func (*OperationError) Unwrap

func (e *OperationError) Unwrap() error

Unwrap 返回底层 Windows 或上下文错误。

type PoisonedError

type PoisonedError struct {
	Cause error
}

PoisonedError 保留首次使 Set 中毒的 ReleaseMutex 故障。

func (*PoisonedError) Code

func (e *PoisonedError) Code() protocol.Code

Code 固定返回普通 Mutex 操作故障码。

func (*PoisonedError) Error

func (e *PoisonedError) Error() string

Error 返回中毒状态及首次原因。

func (*PoisonedError) Is

func (e *PoisonedError) Is(target error) bool

Is 使 errors.Is 可以识别 ErrPoisoned。

func (*PoisonedError) Unwrap

func (e *PoisonedError) Unwrap() error

Unwrap 返回首次 ReleaseMutex 故障。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL