MCPcopy
hub / github.com/kubernetes/client-go / Heap

Struct Heap

tools/cache/heap.go:117–128  ·  view source on GitHub ↗

Heap is a thread-safe producer/consumer queue that implements a heap data structure. It can be used to implement priority queues and similar data structures.

Source from the content-addressed store, hash-verified

115// Heap is a thread-safe producer/consumer queue that implements a heap data structure.
116// It can be used to implement priority queues and similar data structures.
117type Heap struct {
118 lock sync.RWMutex
119 cond sync.Cond
120
121 // data stores objects and has a queue that keeps their ordering according
122 // to the heap invariant.
123 data *heapData
124
125 // closed indicates that the queue is closed.
126 // It is mainly used to let Pop() exit its control loop while waiting for an item.
127 closed bool
128}
129
130// Close the Heap and signals condition variables that may be waiting to pop
131// items from the heap.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected