Rework notify so it's thread safe