sync

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package sync provides a thread-safe structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set[K comparable] struct {
	// contains filtered or unexported fields
}

Set is a thread-safe set implementation using a map.

func NewSet

func NewSet[K comparable]() *Set[K]

NewSet creates a new thread-safe set.

func (*Set[K]) Contains

func (s *Set[K]) Contains(key K) bool

Contains checks if an item exists in the set.

func (*Set[K]) Len

func (s *Set[K]) Len() int

Len returns the number of items in the set.

func (*Set[K]) Release

func (s *Set[K]) Release(key K)

Release removes an item from the set.

func (*Set[K]) Set

func (s *Set[K]) Set(key K)

Set sets an item to the set.

Jump to

Keyboard shortcuts

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