This PR fixes #402 which is caused when more threads than cores (A Github runnuer is limited to only 2 cores) result in multiple thread in a std::atomic::compare_exchange_weak busy loop.
The scheduler then occasionally runs the thread where the compare_exchange succeeds, which make the test run extremely slowly.
This PR fixes #402 which is caused when more threads than cores (A Github runnuer is limited to only 2 cores) result in multiple thread in a std::atomic::compare_exchange_weak busy loop.
The scheduler then occasionally runs the thread where the compare_exchange succeeds, which make the test run extremely slowly.