MCPcopy Create free account
hub / github.com/careercup/ctci / Queue

Struct Queue

go/chapter04/queue/queue.go:44–49  ·  view source on GitHub ↗

A go-routine safe FIFO (first in first out) data stucture.

Source from the content-addressed store, hash-verified

42
43// A go-routine safe FIFO (first in first out) data stucture.
44type Queue struct {
45 head *queuenode
46 tail *queuenode
47 count int
48 lock *sync.Mutex
49}
50
51// Creates a new pointer to a new queue.
52func New() *Queue {

Callers 1

ChapQ3.5.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected