I'm not sure if this is actually wrong, but it seems odd.
authorCarl Hetherington <cth@carlh.net>
Tue, 8 Oct 2024 17:47:30 +0000 (19:47 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 8 Oct 2024 17:47:30 +0000 (19:47 +0200)
I think possibly only the first call to ::instance() would be locked.

src/lib/change_signaller.h

index 1d7d482df2539d8c989609e4cf162a323ceb7bfd..cda36607693de3fdfff6536ab313ceb65f29c34a 100644 (file)
@@ -101,7 +101,7 @@ public:
        static ChangeSignalDespatcher* instance()
        {
                static boost::mutex _instance_mutex;
-               static boost::mutex::scoped_lock lm(_instance_mutex);
+               boost::mutex::scoped_lock lm(_instance_mutex);
                static ChangeSignalDespatcher<T, P>* _instance;
                if (!_instance) {
                        _instance = new ChangeSignalDespatcher<T, P>();