MCPcopy Create free account
hub / github.com/GRAnimated/MinecraftLCE / Pop

Method Pop

src/4JLibraries_Source/XLockFreeStack.cpp:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10template <typename T>
11T* XLockFreeStack<T>::Pop() {
12 EnterCriticalSection(&this->m_mutex);
13 if (m_vector.empty()) {
14 LeaveCriticalSection(&this->m_mutex);
15 return nullptr;
16 }
17
18 T* a = m_vector.back();
19 m_vector.pop_back();
20
21 LeaveCriticalSection(&this->m_mutex);
22
23 return a;
24}

Callers 1

tickMethod · 0.80

Calls 3

EnterCriticalSectionFunction · 0.85
LeaveCriticalSectionFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected