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

Function lockSessionPool

src/proxy/http/HttpSessionManager.cc:419–434  ·  view source on GitHub ↗

Scoped lock of the session pool based on pool type (global_locked vs everything else)

Source from the content-addressed store, hash-verified

417// Scoped lock of the session pool based on pool type
418// (global_locked vs everything else)
419inline bool
420lockSessionPool(Ptr<ProxyMutex> &mutex, EThread *const ethread, TSServerSessionSharingPoolType const pool_type,
421 MutexLock *const mlock, MutexTryLock *const tlock)
422{
423 bool locked = false;
424 if (TS_SERVER_SESSION_SHARING_POOL_GLOBAL_LOCKED == pool_type) {
425 SCOPED_MUTEX_LOCK(lock, mutex, ethread);
426 *mlock = std::move(lock);
427 locked = true;
428 } else {
429 MUTEX_TRY_LOCK(lock, mutex, ethread);
430 *tlock = std::move(lock);
431 locked = tlock->is_locked();
432 }
433 return locked;
434}
435
436} // namespace
437

Callers 2

_acquire_sessionMethod · 0.85
release_sessionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected