Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update src/system/SystemObject.h
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Sandstedt <michael.sandstedt@gmail.com>
yufengwangca and msandstedt committed Aug 12, 2021
1 parent 421cbe5 commit 1131127
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/system/SystemObject.h
Original file line number Diff line number Diff line change
@@ -312,13 +312,11 @@ inline T * ObjectPool<T, N>::TryCreate(Layer & aLayer)
{
std::lock_guard<std::mutex> lock(mMutex);
Object * p = &mDummyHead;

// Traverse down to the end of the list
while (p->next)
if (p->next)
{
p = p->next;
p->next->prev = newNode;
}

newNode->next = p->next;
p->next = newNode;
newNode->prev = p;
newNode->mMutexRef = &mMutex;

0 comments on commit 1131127

Please sign in to comment.