add race detector
format
split into 2 files
format
fix race condition
refactor for better stop mechenism

close a chan means all listeners are notified