Commit Graph

9 Commits

Author SHA1 Message Date
Pierre Bourdon
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
EmptyChaos
c1922783f8 Core: Threadsafety Synchronization Fixes (Frame Advance / FifoPlayer)
Fix Frame Advance and FifoPlayer pause/unpause/stop.

CPU::EnableStepping is not atomic but is called from multiple threads
which races and leaves the system in a random state; also instruction
stepping was unstable, m_StepEvent had an almost random value because
of the dual purpose it served which could cause races where CPU::Run
would SingleStep when it was supposed to be sleeping.

FifoPlayer never FinishStateMove()d which was causing it to deadlock.
Rather than partially reimplementing CPU::Run, just use CPUCoreBase
and then call CPU::Run(). More DRY and less likely to have weird bugs
specific to the player (i.e the previous freezing on pause/stop).

Refactor PowerPC::state into CPU since it manages the state of the
CPU Thread which is controlled by CPU, not PowerPC. This simplifies
the architecture somewhat and eliminates races that can be caused by
calling PowerPC state functions directly instead of using CPU's
(because they bypassed the EnableStepping lock).
2016-05-13 09:23:44 +10:00
Shawn Hoffman
bea18eedc4 [windows] remove various workarounds which were required for vs2013 2015-09-03 04:39:05 -07:00
Tillmann Karras
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Shawn Hoffman
87c324c55a Add Common::Event::WaitFor(), which has the same semantics as std::condition_variable::wait_for() (with millisecond units). 2014-08-17 21:52:40 -07:00
Lioncash
d18d3e1f3e Common: Get rid of StdConditionVariable, StdMutex, and StdThread.
All of the compilers we support have support for these now.
2014-08-16 23:33:19 -04:00
Pierre Bourdon
7074feacbe Common::Event: Add a faster Windows specific implementation based on the concurrency runtime. 2014-04-14 23:13:15 +02:00
Pierre Bourdon
48bd904028 Common::Event: Implement in terms of Common::Flag to get rid of a volatile and optimize with early returns and atomic swaps 2014-04-14 23:13:15 +02:00
Pierre Bourdon
6bdcbad3e4 Common: Move the Event class to a separate file, and add tests for it. Fix includes everywhere to match this. 2014-04-14 10:54:07 +02:00