aboutsummaryrefslogtreecommitdiff
path: root/src/core/core_cpu.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-16 11:21:42 -0400
committerGitHub <noreply@github.com>2018-10-16 11:21:42 -0400
commit88b8383da28f05b2a30ba853b0578fe625f7dba6 (patch)
treef9224c0af9d0ddcc1e2496b638a6108077fcd198 /src/core/core_cpu.h
parent59c1ca8b0c0051a63d57ccb433a96909acf8000c (diff)
parent5484742fdaf036db03ac7b8c746df5004f74efad (diff)
Merge pull request #1502 from lioncash/unique
core: Convert shared_ptr instances into unique_ptr instances where applicable for System and Cpu
Diffstat (limited to 'src/core/core_cpu.h')
-rw-r--r--src/core/core_cpu.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/core_cpu.h b/src/core/core_cpu.h
index ee7e04abc..1d2bdc6cd 100644
--- a/src/core/core_cpu.h
+++ b/src/core/core_cpu.h
@@ -41,8 +41,7 @@ private:
class Cpu {
public:
- Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor,
- std::shared_ptr<CpuBarrier> cpu_barrier, std::size_t core_index);
+ Cpu(ExclusiveMonitor& exclusive_monitor, CpuBarrier& cpu_barrier, std::size_t core_index);
~Cpu();
void RunLoop(bool tight_loop = true);
@@ -59,8 +58,12 @@ public:
return *arm_interface;
}
- const std::shared_ptr<Kernel::Scheduler>& Scheduler() const {
- return scheduler;
+ Kernel::Scheduler& Scheduler() {
+ return *scheduler;
+ }
+
+ const Kernel::Scheduler& Scheduler() const {
+ return *scheduler;
}
bool IsMainCore() const {
@@ -71,14 +74,14 @@ public:
return core_index;
}
- static std::shared_ptr<ExclusiveMonitor> MakeExclusiveMonitor(std::size_t num_cores);
+ static std::unique_ptr<ExclusiveMonitor> MakeExclusiveMonitor(std::size_t num_cores);
private:
void Reschedule();
std::unique_ptr<ARM_Interface> arm_interface;
- std::shared_ptr<CpuBarrier> cpu_barrier;
- std::shared_ptr<Kernel::Scheduler> scheduler;
+ CpuBarrier& cpu_barrier;
+ std::unique_ptr<Kernel::Scheduler> scheduler;
std::atomic<bool> reschedule_pending = false;
std::size_t core_index;