Skip to content

Commit 2dcea8b

Browse files
authored
fix: lazy dead lock
1 parent 5f842c5 commit 2dcea8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lazy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (l *Lazy[T]) slowGet() T {
3030
for !l.locked.CompareAndSwap(0, 1) {
3131
runtime.Gosched()
3232
}
33-
defer l.locked.Store(1)
33+
defer l.locked.Store(0)
3434

3535
if l.done.Load() == 0 {
3636
defer l.done.Store(1)

0 commit comments

Comments
 (0)