Skip to content

Commit 5efb7a9

Browse files
authored
Merge pull request #27 from antlabs/dev
更新
2 parents 34ddd7f + b350175 commit 5efb7a9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

task/stream2/stream2_executor.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func (s *stream2Executor) run(mu *sync.Mutex) bool {
5858
var f func() bool
5959
for i := 0; ; i++ {
6060
if mu != nil {
61+
// 加锁
6162
mu.Lock()
6263
}
6364

@@ -76,6 +77,14 @@ func (s *stream2Executor) run(mu *sync.Mutex) bool {
7677
return false
7778
}
7879

80+
if i >= len(s.list) {
81+
s.list = s.list[0:0]
82+
if mu != nil {
83+
mu.Unlock()
84+
}
85+
return false
86+
}
87+
7988
f = s.list[i]
8089
s.list[i] = nil
8190
if mu != nil {

0 commit comments

Comments
 (0)