go-symbols icon indicating copy to clipboard operation
go-symbols copied to clipboard

Race condition: some symbols not returned

Open dt opened this issue 6 years ago • 0 comments

defer func() {
  mutex.Lock()
  syms = append(syms, v.syms...)
  mutex.Unlock()
}()

defer wg.Done()

The wait group is unblocked by the deferred Done(). Since that is deferred after the deferred append of of the result, it is run first, meaning the group is unblocked before the result is ready.

dt avatar May 23 '18 20:05 dt