Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TicketLock ¶
type TicketLock struct {
// contains filtered or unexported fields
}
a ticket lock implementation acts as a spinlock and insures goroutines complete in the order they called the lock in this helps avoid starvation of goroutines
func (*TicketLock) Lock ¶
func (tl *TicketLock) Lock()
waits until the goroutine's ticket equals the next ticket to be served
func (*TicketLock) Unlock ¶
func (tl *TicketLock) Unlock()
signals a completion of a ticket and makes the lock available for the next ticket
Click to show internal directories.
Click to hide internal directories.