Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGoroutineId ¶
func GetGoroutineId() uint32
Types ¶
type ReentrableSpinLock ¶
type ReentrableSpinLock struct {
// contains filtered or unexported fields
}
Reentrant allowable spin locks
func NewReentrableSpinLock ¶
func NewReentrableSpinLock() *ReentrableSpinLock
func (*ReentrableSpinLock) Lock ¶
func (sl *ReentrableSpinLock) Lock()
func (*ReentrableSpinLock) Unlock ¶
func (sl *ReentrableSpinLock) Unlock()
type SpinLock ¶
type SpinLock uint32
SpinLock implements a simple atomic spin lock, the zero value for a SpinLock is an unlocked spinlock.
func (*SpinLock) Lock ¶
func (sl *SpinLock) Lock()
Lock locks sl. If the lock is already in use, the caller blocks until Unlock is called
func (*SpinLock) TryLock ¶
TryLock will try to lock sl and return whether it succeed or not without blocking.
func (*SpinLock) Unlock ¶
func (sl *SpinLock) Unlock()
Unlock unlocks sl, unlike [Mutex.Unlock](http://golang.org/pkg/sync/#Mutex.Unlock), there's no harm calling it on an unlocked SpinLock
Click to show internal directories.
Click to hide internal directories.