Skip to content

Commit

Permalink
fix(util): fix deadlock
Browse files Browse the repository at this point in the history
Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
  • Loading branch information
cheney-lin authored and csfldf committed Jun 11, 2024
1 parent eb4d284 commit ddfa0c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/util/asyncworker/async_limited_workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ func (alw *AsyncLimitedWorkers) AddWork(work *Work, policy DuplicateWorkPolicy)

func (alw *AsyncLimitedWorkers) poll(stopCh <-chan struct{}) (context.Context, *Work, error) {
alw.workLock.Lock()
defer alw.workLock.Unlock()
work, err := alw.doPoll(stopCh)
if err != nil {
return nil, nil, err
}
ctx := alw.prepareWork(work)
alw.workLock.Unlock()
return ctx, work, nil
}

Expand Down

0 comments on commit ddfa0c4

Please sign in to comment.