syncutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package syncutil provides small synchronisation helpers used internally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RWValue

type RWValue[T any] struct {
	// contains filtered or unexported fields
}

RWValue is a generic value protected by a sync.RWMutex. It is safe for concurrent use.

func (*RWValue[T]) Load

func (r *RWValue[T]) Load() T

Load returns the current value.

func (*RWValue[T]) Store

func (r *RWValue[T]) Store(v T)

Store replaces the current value.

func (*RWValue[T]) Swap

func (r *RWValue[T]) Swap(v T) T

Swap atomically replaces the value and returns the previous one.

Jump to

Keyboard shortcuts

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