mirror of
https://github.com/livekit/livekit.git
synced 2026-10-23 06:32:27 +00:00
Update deque and friends. (#3276)
This commit is contained in:
1 parent
36338bab5c
commit
c8b644934f
9 files changed
+61
-49
No files matched your search
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user