Skip to content

Commit 99306ce

Browse files
authored
Merge pull request #236 from CortexFoundation/dev
torrent/monitor | running status signal switch assert
2 parents 8309c15 + b50844f commit 99306ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

torrentfs/monitor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@ func (m *Monitor) parseBlockTorrentInfo(b *Block, flowCtrl bool) error {
531531

532532
func (m *Monitor) Stop() {
533533
log.Info("Torrent listener closing")
534+
if atomic.LoadInt32(&(m.terminated)) == 1 {
535+
return
536+
}
534537
atomic.StoreInt32(&(m.terminated), 1)
535538
close(m.exitCh)
536539
//m.wg.Wait()

0 commit comments

Comments
 (0)