Skip to content

Commit

Permalink
Merge pull request #236 from CortexFoundation/dev
Browse files Browse the repository at this point in the history
torrent/monitor | running status signal switch assert
  • Loading branch information
ucwong authored Nov 18, 2019
2 parents 8309c15 + b50844f commit 99306ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions torrentfs/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ func (m *Monitor) parseBlockTorrentInfo(b *Block, flowCtrl bool) error {

func (m *Monitor) Stop() {
log.Info("Torrent listener closing")
if atomic.LoadInt32(&(m.terminated)) == 1 {
return
}
atomic.StoreInt32(&(m.terminated), 1)
close(m.exitCh)
//m.wg.Wait()
Expand Down

0 comments on commit 99306ce

Please sign in to comment.