mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 09:18:40 +12:00
Move busy_wait() to asm.hpp
This commit is contained in:
parent
908465b274
commit
4cfa9b11f3
8 changed files with 21 additions and 8 deletions
|
@ -905,10 +905,3 @@ struct value_hash
|
|||
return static_cast<std::size_t>(value) >> Shift;
|
||||
}
|
||||
};
|
||||
|
||||
// Synchronization helper (cache-friendly busy waiting)
|
||||
inline void busy_wait(std::size_t cycles = 3000)
|
||||
{
|
||||
const u64 s = __rdtsc();
|
||||
do _mm_pause(); while (__rdtsc() - s < cycles);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue