diff options
| author | 2014-09-04 20:36:21 -0400 | |
|---|---|---|
| committer | 2014-09-04 20:36:21 -0400 | |
| commit | 5d95d038a0e5d203a568223da12b57c30d048a8c (patch) | |
| tree | 7aaaa7f594244f81c2fc813d40e099a5bbc1a9e8 /src/core | |
| parent | Merge pull request #89 from archshift/X11-OSX (diff) | |
| parent | Removed common/atomic, instead using std::atomic (diff) | |
| download | yuzu-5d95d038a0e5d203a568223da12b57c30d048a8c.tar.gz yuzu-5d95d038a0e5d203a568223da12b57c30d048a8c.tar.xz yuzu-5d95d038a0e5d203a568223da12b57c30d048a8c.zip | |
Merge pull request #88 from archshift/remove-atomic
Removed common/atomic, instead using std::atomic
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/core_timing.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index a4fc0aaa4..c30e36732 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -4,10 +4,10 @@ | |||
| 4 | 4 | ||
| 5 | #include <vector> | 5 | #include <vector> |
| 6 | #include <cstdio> | 6 | #include <cstdio> |
| 7 | #include <atomic> | ||
| 7 | 8 | ||
| 8 | #include "common/msg_handler.h" | 9 | #include "common/msg_handler.h" |
| 9 | #include "common/std_mutex.h" | 10 | #include "common/std_mutex.h" |
| 10 | #include "common/atomic.h" | ||
| 11 | #include "common/chunk_file.h" | 11 | #include "common/chunk_file.h" |
| 12 | 12 | ||
| 13 | #include "core/core_timing.h" | 13 | #include "core/core_timing.h" |
| @@ -54,7 +54,7 @@ Event *eventPool = 0; | |||
| 54 | Event *eventTsPool = 0; | 54 | Event *eventTsPool = 0; |
| 55 | int allocatedTsEvents = 0; | 55 | int allocatedTsEvents = 0; |
| 56 | // Optimization to skip MoveEvents when possible. | 56 | // Optimization to skip MoveEvents when possible. |
| 57 | volatile u32 hasTsEvents = false; | 57 | std::atomic<u32> hasTsEvents; |
| 58 | 58 | ||
| 59 | // Downcount has been moved to currentMIPS, to save a couple of clocks in every ARM JIT block | 59 | // Downcount has been moved to currentMIPS, to save a couple of clocks in every ARM JIT block |
| 60 | // as we can already reach that structure through a register. | 60 | // as we can already reach that structure through a register. |
| @@ -202,7 +202,7 @@ void ScheduleEvent_Threadsafe(s64 cyclesIntoFuture, int event_type, u64 userdata | |||
| 202 | tsLast->next = ne; | 202 | tsLast->next = ne; |
| 203 | tsLast = ne; | 203 | tsLast = ne; |
| 204 | 204 | ||
| 205 | Common::AtomicStoreRelease(hasTsEvents, 1); | 205 | hasTsEvents.store(1, std::memory_order_release); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | // Same as ScheduleEvent_Threadsafe(0, ...) EXCEPT if we are already on the CPU thread | 208 | // Same as ScheduleEvent_Threadsafe(0, ...) EXCEPT if we are already on the CPU thread |
| @@ -484,7 +484,7 @@ void ProcessFifoWaitEvents() | |||
| 484 | 484 | ||
| 485 | void MoveEvents() | 485 | void MoveEvents() |
| 486 | { | 486 | { |
| 487 | Common::AtomicStoreRelease(hasTsEvents, 0); | 487 | hasTsEvents.store(0, std::memory_order_release); |
| 488 | 488 | ||
| 489 | std::lock_guard<std::recursive_mutex> lk(externalEventSection); | 489 | std::lock_guard<std::recursive_mutex> lk(externalEventSection); |
| 490 | // Move events from async queue into main queue | 490 | // Move events from async queue into main queue |