atomic

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chan

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

A Chan is an atomic channel of type chan T. The zero value is a nil channel.

func (*Chan[T]) CompareAndSwap

func (c *Chan[T]) CompareAndSwap(old, new chan T) (swapped bool)

CompareAndSwap executes the compare-and-swap operation for c.

func (*Chan[T]) Load

func (c *Chan[T]) Load() (ch chan T)

Load atomically loads and returns the value stored in c.

func (*Chan[T]) Store

func (c *Chan[T]) Store(ch chan T)

Store atomically stores ch into c.

func (*Chan[T]) Swap

func (c *Chan[T]) Swap(new chan T) (old chan T)

Swap atomically stores new into c and returns the previous value.

Jump to

Keyboard shortcuts

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