Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/hx/gc/Immix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,9 @@ struct GlobalChunks
int expected{ 0 };
while(false == processListPopLock.compare_exchange_strong(expected, 1))
{
// A failed exchange stores the current value in expected; without this the next
// attempt would compare against 1 and take a lock another thread still holds.
expected = 0;
// Spin
#ifdef PROFILE_THREAD_USAGE
sSpinCount++;
Expand Down Expand Up @@ -1739,6 +1742,9 @@ struct GlobalChunks
int expected{ 0 };
while(false == freeListPopLock.compare_exchange_strong(expected, 1))
{
// A failed exchange stores the current value in expected; without this the next
// attempt would compare against 1 and take a lock another thread still holds.
expected = 0;
// Spin
#ifdef PROFILE_THREAD_USAGE
sSpinCount++;
Expand Down