core: Make CPUBarrier a unique_ptr instead of a shared_ptr

This will always outlive the Cpu instances, since it's destroyed after
we destroy the Cpu instances on shutdown, so there's no need for shared
ownership semantics here.
This commit is contained in:
Lioncash 2018-10-15 08:42:06 -04:00
parent b3cca34f50
commit c34efbbd60
3 changed files with 10 additions and 11 deletions

View file

@ -41,8 +41,8 @@ private:
class Cpu {
public:
Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor,
std::shared_ptr<CpuBarrier> cpu_barrier, std::size_t core_index);
Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, CpuBarrier& cpu_barrier,
std::size_t core_index);
~Cpu();
void RunLoop(bool tight_loop = true);
@ -77,7 +77,7 @@ private:
void Reschedule();
std::unique_ptr<ARM_Interface> arm_interface;
std::shared_ptr<CpuBarrier> cpu_barrier;
CpuBarrier& cpu_barrier;
std::shared_ptr<Kernel::Scheduler> scheduler;
std::atomic<bool> reschedule_pending = false;