MCPcopy Create free account
hub / github.com/apache/trafficserver / getStateByName

Method getStateByName

plugins/prefetch/fetch.h:137–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 }
136
137 BgFetchState *
138 getStateByName(const String &space)
139 {
140 BgFetchState *state;
141 std::map<String, BgFetchState *>::iterator it;
142
143 TSMutexLock(_prefetchStates->_lock);
144 it = _prefetchStates->_states.find(space);
145 if (it != _prefetchStates->_states.end()) {
146 state = it->second;
147 } else {
148 state = new BgFetchState();
149 _prefetchStates->_states[space] = state;
150 }
151 TSMutexUnlock(_prefetchStates->_lock);
152 return state;
153 }
154
155private:
156 BgFetchStates() : _lock(TSMutexCreate()) {}

Callers 1

TSRemapNewInstanceFunction · 0.80

Calls 4

TSMutexLockFunction · 0.85
TSMutexUnlockFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected