Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain is a helper to implement internally sequential execution of parallel jobs.
NOTE: Init MUST be called before calling other methods
func (*Chain) Go ¶
Go spawns a new goroutine in the Synchain, user func MUST call Lock with the provided ticket
on error return of user func, it calls Cancel and Done, otherwise, calls Unlock and Done
type SpinLock ¶
SpinLock implements sync.Locker using atomic CAS and runtime.Gosched
func (*SpinLock) Lock ¶
func (l *SpinLock) Lock()
Lock sets l from 0 to 1 by atomic CAS, when l is not 0, wait until it is 0
Click to show internal directories.
Click to hide internal directories.