mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
Use taskID mutex properly
This commit is contained in:
parent
bca15cf6b1
commit
623fdb4f33
1 changed files with 3 additions and 0 deletions
|
|
@ -65,9 +65,12 @@ func (t *TaskManager) NewTask(f func(ctx context.Context)) error {
|
|||
|
||||
t.waitingMutex.Lock()
|
||||
defer t.waitingMutex.Unlock()
|
||||
t.taskIDMutex.Lock()
|
||||
if taskID < t.newTaskId {
|
||||
t.taskIDMutex.Unlock()
|
||||
return
|
||||
}
|
||||
t.taskIDMutex.Unlock()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
notifyStopped := make(chan struct{})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue