Implement exclusive monitor
This commit is contained in:
parent
258a5cee84
commit
0b1c2e5505
9 changed files with 160 additions and 13 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <mutex>
|
||||
#include <string>
|
||||
#include "common/common_types.h"
|
||||
#include "core/arm/exclusive_monitor.h"
|
||||
|
||||
class ARM_Interface;
|
||||
|
||||
|
@ -40,7 +41,8 @@ private:
|
|||
|
||||
class Cpu {
|
||||
public:
|
||||
Cpu(std::shared_ptr<CpuBarrier> cpu_barrier, size_t core_index);
|
||||
Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor,
|
||||
std::shared_ptr<CpuBarrier> cpu_barrier, size_t core_index);
|
||||
|
||||
void RunLoop(bool tight_loop = true);
|
||||
|
||||
|
@ -64,6 +66,12 @@ public:
|
|||
return core_index == 0;
|
||||
}
|
||||
|
||||
size_t CoreIndex() const {
|
||||
return core_index;
|
||||
}
|
||||
|
||||
static std::shared_ptr<ExclusiveMonitor> MakeExclusiveMonitor(size_t num_cores);
|
||||
|
||||
private:
|
||||
void Reschedule();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue