20 static std::shared_ptr<RequestQueue> mRequestQueueInstance;
21 static std::mutex instanceProtectionLock;
30 static std::shared_ptr<RequestQueue> getInstance() {
31 if(mRequestQueueInstance ==
nullptr) {
32 instanceProtectionLock.lock();
33 if(mRequestQueueInstance ==
nullptr) {
35 mRequestQueueInstance = std::shared_ptr<RequestQueue> (
new RequestQueue());
36 }
catch(
const std::bad_alloc& e) {
37 instanceProtectionLock.unlock();
41 instanceProtectionLock.unlock();
43 return mRequestQueueInstance;