mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-27 01:07:10 +00:00
fix: wrong usage of RLock
This commit is contained in:
@@ -59,8 +59,8 @@ func (q *Queue[T]) Copy() []T {
|
||||
|
||||
// Len returns the number of items in this queue.
|
||||
func (q *Queue[T]) Len() int64 {
|
||||
q.lock.Lock()
|
||||
defer q.lock.Unlock()
|
||||
q.lock.RLock()
|
||||
defer q.lock.RUnlock()
|
||||
|
||||
return int64(len(q.items))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user