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

Method acquire

plugins/prefetch/fetch.cc:250–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250bool
251BgFetchState::acquire(const String &url)
252{
253 bool permitted = true;
254 if (nullptr != _policy) {
255 TSMutexLock(_policyLock);
256 permitted = _policy->acquire(url);
257 TSMutexUnlock(_policyLock);
258 }
259
260 if (permitted) {
261 incrementMetric(FETCH_POLICY_YES);
262 } else {
263 incrementMetric(FETCH_POLICY_NO);
264 }
265
266 if (nullptr != _policy) {
267 setMetric(FETCH_POLICY_SIZE, _policy->getSize());
268 }
269
270 return permitted;
271}
272
273bool
274BgFetchState::release(const String &url)

Callers 3

contHandleFetchFunction · 0.45
uniqueAcquireMethod · 0.45
initMethod · 0.45

Calls 3

TSMutexLockFunction · 0.85
TSMutexUnlockFunction · 0.85
getSizeMethod · 0.45

Tested by

no test coverage detected