mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31: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()
|
t.waitingMutex.Lock()
|
||||||
defer t.waitingMutex.Unlock()
|
defer t.waitingMutex.Unlock()
|
||||||
|
t.taskIDMutex.Lock()
|
||||||
if taskID < t.newTaskId {
|
if taskID < t.newTaskId {
|
||||||
|
t.taskIDMutex.Unlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
t.taskIDMutex.Unlock()
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
notifyStopped := make(chan struct{})
|
notifyStopped := make(chan struct{})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue