adjust / rmq

Message queue system written in Go and backed by Redis
MIT License
1.57k stars 206 forks source link

fix: fix data race(consumingStopped var member) in redisQueue #53

Closed xpzouying closed 6 years ago

xpzouying commented 6 years ago

Fix #48

consumingStopped in redisQueue has data race when call StopConsuming(), because read in consume() and write in StopConsuming() in concurrency,

Use atomic.LoadInt32/StoreInt32 to change consumingStopped status to ensure safety in multiple goroutine.

wellle commented 6 years ago

Thank you!