Processing messages while a new subscription is taking place causes a race condition.
This MR adds a RW mutex to avoid subscribing to a topic while a reading is being performed.