krisleech/wisper — pull request #12 by chatgris (2013-05-14 11:42:10+00:00)
Title: Fix a potential threadsafe issue

Lazily setting @mutex could lead to have two mutexes with a sample code
like:

``` ruby
[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