package
Version:
v0.0.2
Opens a new window with list of versions in this module.
Published: Apr 29, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Chan[T any] struct {
}
A Chan is an atomic channel of type chan T. The zero value is a nil channel.
func (c *Chan[T]) CompareAndSwap(old, new chan T) (swapped bool)
CompareAndSwap executes the compare-and-swap operation for c.
func (c *Chan[T]) Load() (ch chan T)
Load atomically loads and returns the value stored in c.
func (c *Chan[T]) Store(ch chan T)
Store atomically stores ch into c.
func (c *Chan[T]) Swap(new chan T) (old chan T)
Swap atomically stores new into c and returns the previous value.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.