spin_lock: Unlocked at initilization time

This commit is contained in:
merry 2023-05-17 15:34:19 +01:00
parent 7da378033a
commit f7296572ba
3 changed files with 3 additions and 7 deletions

View file

@ -12,9 +12,7 @@
namespace Dynarmic { namespace Dynarmic {
ExclusiveMonitor::ExclusiveMonitor(size_t processor_count) ExclusiveMonitor::ExclusiveMonitor(size_t processor_count)
: exclusive_addresses(processor_count, INVALID_EXCLUSIVE_ADDRESS), exclusive_values(processor_count) { : exclusive_addresses(processor_count, INVALID_EXCLUSIVE_ADDRESS), exclusive_values(processor_count) {}
Unlock();
}
size_t ExclusiveMonitor::GetProcessorCount() const { size_t ExclusiveMonitor::GetProcessorCount() const {
return exclusive_addresses.size(); return exclusive_addresses.size();

View file

@ -12,9 +12,7 @@
namespace Dynarmic { namespace Dynarmic {
ExclusiveMonitor::ExclusiveMonitor(size_t processor_count) ExclusiveMonitor::ExclusiveMonitor(size_t processor_count)
: exclusive_addresses(processor_count, INVALID_EXCLUSIVE_ADDRESS), exclusive_values(processor_count) { : exclusive_addresses(processor_count, INVALID_EXCLUSIVE_ADDRESS), exclusive_values(processor_count) {}
Unlock();
}
size_t ExclusiveMonitor::GetProcessorCount() const { size_t ExclusiveMonitor::GetProcessorCount() const {
return exclusive_addresses.size(); return exclusive_addresses.size();

View file

@ -11,7 +11,7 @@ struct SpinLock {
void Lock(); void Lock();
void Unlock(); void Unlock();
volatile int storage; volatile int storage = 0;
}; };
} // namespace Dynarmic } // namespace Dynarmic