Skip to content

Commit

Permalink
resourcemanage: avoid to get nil pointer after task finishes when to …
Browse files Browse the repository at this point in the history
…call Stop

Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Jan 18, 2023
1 parent ea6891f commit 7654271
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/gpool/spmc/spmcpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ func TestStopPool(t *testing.T) {
control.Stop()
close(exit)
control.Wait()
// it should pass. Stop can be used after the pool is closed. we should prevent it from panic.
control.Stop()
wg.Wait()
// close pool
pool.ReleaseAndWait()
Expand Down

0 comments on commit 7654271

Please sign in to comment.