From 7497331f47f0171ae732388c334b6bf4be35ddf0 Mon Sep 17 00:00:00 2001 From: tycho garen Date: Wed, 12 May 2021 10:37:01 -0400 Subject: [PATCH] change lock --- libs/clist/clist.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/clist/clist.go b/libs/clist/clist.go index 88b6ddb5f..2067e6275 100644 --- a/libs/clist/clist.go +++ b/libs/clist/clist.go @@ -290,9 +290,8 @@ func (l *CList) BackWait() *CElement { // WaitChan can be used to wait until Front or Back becomes not nil. Once it // does, channel will be closed. func (l *CList) WaitChan() <-chan struct{} { - l.mtx.Lock() - defer l.mtx.Unlock() - + l.mtx.RLock() + defer l.mtx.RUnlock() wg := l.wg ret := make(chan struct{})