diff --git a/UsbDk/UsbDkUtil.h b/UsbDk/UsbDkUtil.h index 7f38e38..21f511a 100644 --- a/UsbDk/UsbDkUtil.h +++ b/UsbDk/UsbDkUtil.h @@ -96,8 +96,7 @@ public: TEntryType *Pop() { CLockedContext LockedContext(*this); - CounterDecrement(); - return TEntryType::GetByListEntry(RemoveHeadList(&m_List)); + return Pop_LockLess(); } ULONG Push(TEntryType *Entry) @@ -129,7 +128,7 @@ public: CLockedContext LockedContext(*this); while (!IsListEmpty(&m_List)) { - Functor(Pop()); + Functor(Pop_LockLess()); } } @@ -166,6 +165,12 @@ private: } } + TEntryType *Pop_LockLess() + { + CounterDecrement(); + return TEntryType::GetByListEntry(RemoveHeadList(&m_List)); + } + LIST_ENTRY m_List; ULONG m_NumEntries = 0; };