Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TwoLockQueue ¶
type TwoLockQueue[T any] struct { // contains filtered or unexported fields }
TwoLockQueue is a concurrent unbounded queue which uses two-Lock concurrent queue algorithm.
func NewTwoLockQueue ¶
func NewTwoLockQueue[T any]() *TwoLockQueue[T]
NewTwoLockQueue returns an empty TwoLockQueue.
func (*TwoLockQueue[T]) IsEmpty ¶
func (q *TwoLockQueue[T]) IsEmpty() bool
IsEmpty returns true if the container length == 0
func (*TwoLockQueue[T]) Peek ¶
func (q *TwoLockQueue[T]) Peek() (T, bool)
Peek Retrieves, but does not remove, the head of this queue, or returns (nil, false) if this queue is empty.
func (*TwoLockQueue[T]) Poll ¶
func (q *TwoLockQueue[T]) Poll() (T, bool)
Poll Retrieves and removes the head of this queue, or returns (nil, false) if this queue is empty.
func (*TwoLockQueue[T]) Push ¶
func (q *TwoLockQueue[T]) Push(vs ...T)
Push adds items of vs to the tail of queue
Click to show internal directories.
Click to hide internal directories.