adtosync

package
v1.74.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ADTOSync

type ADTOSync struct {
	Invalidated bool
	// contains filtered or unexported fields
}

func (*ADTOSync) SealWithTimeout

func (ds *ADTOSync) SealWithTimeout(ctxUp context.Context, to time.Duration)

func (*ADTOSync) Unseal

func (ds *ADTOSync) Unseal()

func (*ADTOSync) Wait

func (ds *ADTOSync) Wait() (err error)

type FastAsyncOnce

type FastAsyncOnce struct {
	// contains filtered or unexported fields
}
func (o *Once) Do(f func()) {
	// Note: Here is an incorrect implementation of Do:
	//
	//	if atomic.CompareAndSwapUint32(&o.done, 0, 1) {
	//		f()
	//	}
	//
	// Do guarantees that when it returns, f has finished.
	// This implementation would not implement that guarantee:
	// given two simultaneous calls, the winner of the cas would
	// call f, and the second would return immediately, without
	// waiting for the first's call to f to complete.
	// This is why the slow path falls back to a mutex, and why
	// the atomic.StoreUint32 must be delayed until after f returns.

p.s. we don't need that guarantee here, therefore need a CAS specifically

func (*FastAsyncOnce) Do

func (o *FastAsyncOnce) Do(f func())

Jump to

Keyboard shortcuts

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