92 static std::shared_ptr<CocoTable> mCocoTableInstance;
93 static std::mutex instanceProtectionLock;
95 std::vector<ResConfInfo*> mResourceTable;
96 std::unordered_map<int32_t, int32_t> mFlatClusterMap;
97 std::unordered_map<int32_t, int32_t> mFlatCGroupMap;
99 std::shared_ptr<ResourceRegistry> mResourceRegistry;
114 void timerExpired(
Request* req);
115 void applyAction(ResIterable* currNode, int32_t index, int8_t priority);
116 void removeAction(int32_t index,
Resource* resource);
118 int32_t getCocoTablePrimaryIndex(uint32_t resCode);
119 int32_t getCocoTableSecondaryIndex(
Resource* resource, int8_t priority);
121 void deleteNode(ResIterable* node,
122 int32_t primaryIndex,
123 int32_t secondaryIndex);
125 int8_t insertInCocoTable(ResIterable* currNode, int8_t priority);
127 void fastPathApply(
Resource* resource);
128 void fastPathReset(
Resource* resource);
129 int8_t needAllocation(
Resource* res);
173 static std::shared_ptr<CocoTable> getInstance() {
174 if(mCocoTableInstance ==
nullptr) {
175 instanceProtectionLock.lock();
176 if(mCocoTableInstance ==
nullptr) {
178 mCocoTableInstance = std::shared_ptr<CocoTable> (
new CocoTable());
179 }
catch(
const std::bad_alloc& e) {
180 instanceProtectionLock.unlock();
184 instanceProtectionLock.unlock();
186 return mCocoTableInstance;