Update deque and friends. (#3276)

This commit is contained in:
Raja Subramanian authored and GitHub committed 2024-12-20 07:16:14 +05:30
1 parent 36338bab5c
commit c8b644934f
9 files changed
+61 -49

No files matched your search

+3 -3
View File
@@ -15,7 +15,6 @@
package utils
import (
"math/bits"
"sync"
"github.com/gammazero/deque"
@@ -81,12 +80,13 @@ type opsQueueBase[T opsQueueItem] struct {
}
func newOpsQueueBase[T opsQueueItem](params OpsQueueParams) *opsQueueBase[T] {
return &opsQueueBase[T]{
o := &opsQueueBase[T]{
params: params,
ops: *deque.New[T](min(bits.Len64(uint64(params.MinSize-1)), 7)),
wake: make(chan struct{}, 1),
doneChan: make(chan struct{}),
}
o.ops.SetBaseCap(int(min(params.MinSize, 128)))
return o
}
func (oq *opsQueueBase[T]) Start() {