21 static std::shared_ptr<SignalQueue> mSignalQueueInstance;
22 static std::mutex instanceProtectionLock;
31 static std::shared_ptr<SignalQueue> getInstance() {
32 if(mSignalQueueInstance ==
nullptr) {
33 instanceProtectionLock.lock();
34 if(mSignalQueueInstance ==
nullptr) {
36 mSignalQueueInstance = std::shared_ptr<SignalQueue> (
new SignalQueue());
37 }
catch(
const std::bad_alloc& e) {
38 instanceProtectionLock.unlock();
42 instanceProtectionLock.unlock();
44 return mSignalQueueInstance;