mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-21 05:24:28 +02:00
go fmt
This commit is contained in:
1 parent
2a7028373d
commit
1b4484bf0a
31 files changed
+116
-117
No files matched your search
@@ -32,12 +32,12 @@ func NewBufferedQueue[T any](chunkSize int) *BufferedQueue[T] {
|
||||
// Create an empty chunk to initialize head and tail
|
||||
chunk := &ItemChunkNode[T]{items: make([]T, chunkSize), nodeId: 0}
|
||||
bq := &BufferedQueue[T]{
|
||||
chunkSize: chunkSize,
|
||||
head: chunk,
|
||||
tail: chunk,
|
||||
last: chunk,
|
||||
count: 0,
|
||||
mutex: sync.Mutex{},
|
||||
chunkSize: chunkSize,
|
||||
head: chunk,
|
||||
tail: chunk,
|
||||
last: chunk,
|
||||
count: 0,
|
||||
mutex: sync.Mutex{},
|
||||
}
|
||||
bq.waitCond = sync.NewCond(&bq.mutex)
|
||||
return bq
|
||||
@@ -87,7 +87,7 @@ func (q *BufferedQueue[T]) Dequeue() (T, bool) {
|
||||
q.mutex.Lock()
|
||||
defer q.mutex.Unlock()
|
||||
|
||||
for q.count <= 0 && !q.isClosed {
|
||||
for q.count <= 0 && !q.isClosed {
|
||||
q.waitCond.Wait()
|
||||
}
|
||||
if q.count <= 0 && q.isClosed {
|
||||
|
||||
Reference in new issue
Block a user