mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-07 10:16:07 +00:00

This reverts my change to pseudo_barrier.h which isn't necessary anymore after Fred's fix to debugserver and caused TestThreadStepOut to fail. llvm-svn: 370963
22 lines
788 B
C++
22 lines
788 B
C++
#include <atomic>
|
|
|
|
// Note that although hogging the CPU while waiting for a variable to change
|
|
// would be terrible in production code, it's great for testing since it avoids
|
|
// a lot of messy context switching to get multiple threads synchronized.
|
|
|
|
typedef std::atomic<int> pseudo_barrier_t;
|
|
|
|
#define pseudo_barrier_wait(barrier) \
|
|
do \
|
|
{ \
|
|
--(barrier); \
|
|
while ((barrier).load() > 0) \
|
|
; \
|
|
} while (0)
|
|
|
|
#define pseudo_barrier_init(barrier, count) \
|
|
do \
|
|
{ \
|
|
(barrier) = (count); \
|
|
} while (0)
|