change lock

This commit is contained in:
tycho garen
2021-05-12 10:38:47 -04:00
parent d893463bb8
commit 7497331f47
+2 -3
View File
@@ -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{})