sync package - sync - Go Packages
Package sync provides basic synchronization primitives such as mutual exclusion locks. Other than the Once and WaitGroup types, most are intended for use by low-level library routines. Higher-level synchronization is better done via channels and communication. Values containing the types defined in this package should not be copied. This section is empty. This section is empty. OnceFunc returns a function that invokes f only once. The returned function may be called concurrently. If f panics, the returned function will panic with the same value on every call. OnceValue returns a function that invokes f only once and returns the value returned by f. The returned function may be called concurrently. If f panics, the returned function will panic with the same value on every call. OnceValues returns a function that invokes f only once and returns the values returned by f. The returned function may be called concurrently. If f panics, the returned function will panic with the same value on
Documentation ¶ Overview ¶ Package sync provides basic synchronization primitives such as mutual exclusion locks. Other than the Once and WaitGroup types, most are intended for use by low-level library routines. Higher-level synchronization is better done via channels and communication. Values containing the types defined in this package should not be copied. Index ¶ func OnceFunc(f func()) func() func OnceValue[T any](f func() T) func() T func OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2) type Cond func NewCond(l Locker) *Cond func (c *Cond) Broadcast() func (c *Cond) Signal() fun
saved by
related reading
- Demystifying Function Parameters in Go- Alex Edwardsalexedwards.net
- Go Slices: usage and internals - The Go Programming Languagego.dev
- Notes on structured concurrency, or: Go statement considered harmful - njs blogvorpus.org
- The Go Memory Model - The Go Programming Languagego.dev
- golang mutex, go mutex, mutex lock golang, golang mutex example, sync.RWMutexgolinuxcloud.com
- Mutex in std::sync - Rustdoc.rust-lang.org
- Frequently Asked Questions (FAQ) - The Go Programming Languagego.dev
- Package names - The Go Programming Languagego.dev
- std::sync::mpsc - Rustdoc.rust-lang.org
- Mastering Concurrency in Go with errgroup: Simplifying Goroutine Management — Coding Explorationscodingexplorations.com
- Channels | Tokio - An asynchronous Rust runtimetokio.rs
- Data Race Detector - The Go Programming Languagego.dev