mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-10-31 07:59:02 -05:00 
			
		
		
		
	Core/Common: Address Feedback.
This commit is contained in:
		| @@ -3,6 +3,7 @@ | ||||
| // Refer to the license.txt file included. | ||||
|  | ||||
| #include <chrono> | ||||
| #include <mutex> | ||||
| #include <thread> | ||||
|  | ||||
| #ifdef _MSC_VER | ||||
| @@ -52,7 +53,7 @@ NativeClock::NativeClock(u64 emulated_cpu_frequency, u64 emulated_clock_frequenc | ||||
| } | ||||
|  | ||||
| u64 NativeClock::GetRTSC() { | ||||
|     rtsc_serialize.lock(); | ||||
|     std::scoped_lock scope{rtsc_serialize}; | ||||
|     _mm_mfence(); | ||||
|     const u64 current_measure = __rdtsc(); | ||||
|     u64 diff = current_measure - last_measure; | ||||
| @@ -61,7 +62,6 @@ u64 NativeClock::GetRTSC() { | ||||
|         last_measure = current_measure; | ||||
|     } | ||||
|     accumulated_ticks += diff; | ||||
|     rtsc_serialize.unlock(); | ||||
|     /// The clock cannot be more precise than the guest timer, remove the lower bits | ||||
|     return accumulated_ticks & inaccuracy_mask; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Fernando Sahmkow
					Fernando Sahmkow