Fix locks in worker-tracked
This commit is contained in:
parent
70589e4406
commit
080aa3356a
7
extern/sector-storage/worker_tracked.go
vendored
7
extern/sector-storage/worker_tracked.go
vendored
@ -73,6 +73,9 @@ func (wt *workTracker) track(ctx context.Context, ready chan struct{}, wid Worke
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wt.lk.Lock()
|
||||||
|
defer wt.lk.Unlock()
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-ready:
|
case <-ready:
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
@ -83,6 +86,7 @@ func (wt *workTracker) track(ctx context.Context, ready chan struct{}, wid Worke
|
|||||||
wt.prepared[prepID] = tracked(storiface.RWPrepared, storiface.UndefCall)
|
wt.prepared[prepID] = tracked(storiface.RWPrepared, storiface.UndefCall)
|
||||||
|
|
||||||
wt.lk.Unlock()
|
wt.lk.Unlock()
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-ready:
|
case <-ready:
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
@ -100,8 +104,7 @@ func (wt *workTracker) track(ctx context.Context, ready chan struct{}, wid Worke
|
|||||||
return callID, err
|
return callID, err
|
||||||
}
|
}
|
||||||
|
|
||||||
wt.lk.Lock()
|
|
||||||
defer wt.lk.Unlock()
|
|
||||||
|
|
||||||
_, done := wt.done[callID]
|
_, done := wt.done[callID]
|
||||||
if done {
|
if done {
|
||||||
|
Loading…
Reference in New Issue
Block a user