Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix a potential threadsafe issue
Lazily setting @mutex could lead to have two mutexes with a sample code like: [MyListener.new, MailListener.new].each do |listener| Thread.new { Wisper::GlobalListeners.add_listener(listener) } end This example is cumbersome, but well, it shows the idea. Even with a singleton, if `add_listener` is called a first time by two different threads, this could lead to thread safety issues for ruby implementation without a gvl. Signed-off-by: chatgris <jboyer@af83.com>
- Loading branch information