mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
RLock() for readonly operation (#11603)
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
parent
0fd5253915
commit
a0c5669511
@ -152,8 +152,8 @@ func (pq *PriorityQueue) PopByKey(key string) (*Item, error) {
|
||||
// RetrieveByKey searches the queue for an item with the given key and returns it
|
||||
// from the queue if found. Returns nil if not found.
|
||||
func (pq *PriorityQueue) RetrieveByKey(key string) *Item {
|
||||
pq.lock.Lock()
|
||||
defer pq.lock.Unlock()
|
||||
pq.lock.RLock()
|
||||
defer pq.lock.RUnlock()
|
||||
|
||||
item, ok := pq.dataMap[key]
|
||||
if !ok {
|
||||
|
Loading…
Reference in New Issue
Block a user