locked

package
v0.0.0-...-7b48451 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package locked provides concurrency-safe helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMutex

func NewMutex(grace time.Duration) sync.Locker

NewMutex returns a usable sync.Locker with the specified grace period.

Types

type BytesBuffer

type BytesBuffer struct {
	// contains filtered or unexported fields
}

BytesBuffer is a locked bytes.Buffer.

func (*BytesBuffer) String

func (b *BytesBuffer) String() string

func (*BytesBuffer) Write

func (b *BytesBuffer) Write(p []byte) (int, error)

type Mutex

type Mutex struct {
	// contains filtered or unexported fields
}

Mutex is a deadlock debugging lock. It will panic in a deadlock of longer than a defined grace period.

func (*Mutex) Lock

func (m *Mutex) Lock()

Lock locks the lock or panics after the grace period indicating the position of the last successful lock call.

func (*Mutex) Unlock

func (m *Mutex) Unlock()

Unlock unlocks the lock.

Jump to

Keyboard shortcuts

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