Added some missing semaphore/mutex resets, and bugfixed the emitter when using a certain type of complex indirect sddressing ( ie, ptr32[addr + (eax*4)] )

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2026 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-10-17 23:30:16 +00:00
parent 0880cadf64
commit 6b0c9cfdfe
4 changed files with 7 additions and 17 deletions

View File

@ -232,10 +232,12 @@ namespace x86Emitter
else if( Index.IsEmpty() )
{
Index = src.Index;
Factor = 1;
Factor = src.Factor;
}
else if( Index == src.Index )
Factor++;
{
Factor += src.Factor;
}
else
pxFailDev( L"x86Emitter: address modifiers cannot have more than two index registers." ); // oops, only 2 regs allowed per ModRm!

View File

@ -144,6 +144,7 @@ void Threading::PersistentThread::Start()
Detach(); // clean up previous thread handle, if one exists.
FrankenMutex( m_lock_InThread );
m_sem_event.Reset();
OnStart();

View File

@ -282,8 +282,7 @@ void mtgsThreadObject::ExecuteTaskInThread()
AtomicExchange(m_RingPos, 0);
// stall for a bit to let the MainThread have time to update the g_pGSWritePos.
m_lock_RingRestart.Lock();
m_lock_RingRestart.Unlock();
m_lock_RingRestart.Wait();
StateCheckInThread( false ); // disable cancel since the above locks are cancelable already
continue;

View File

@ -55,7 +55,7 @@ void SysThreadBase::OnStart()
if( !pxAssertDev( m_ExecMode == ExecMode_NoThreadYet, "SysSustainableThread:Start(): Invalid execution mode" ) ) return;
m_ResumeEvent.Reset();
//m_SuspendEvent.Reset();
FrankenMutex( m_ExecModeMutex );
FrankenMutex( m_RunningLock );
_parent::OnStart();
@ -228,16 +228,6 @@ void SysThreadBase::OnCleanupInThread()
void SysThreadBase::StateCheckInThread( bool isCancelable )
{
// Shortcut for the common case, to avoid unnecessary Mutex locks:
/*if( m_ExecMode == ExecMode_Opened )
{
if( isCancelable ) TestCancel();
return;
}
// Oh, seems we need a full lock, because something special is happening!
ScopedLock locker( m_ExecModeMutex );*/
switch( m_ExecMode )
{
@ -266,7 +256,6 @@ void SysThreadBase::StateCheckInThread( bool isCancelable )
// fallthrough...
case ExecMode_Paused:
//locker.Unlock();
while( m_ExecMode == ExecMode_Paused )
m_ResumeEvent.WaitRaw();
@ -284,7 +273,6 @@ void SysThreadBase::StateCheckInThread( bool isCancelable )
// fallthrough...
case ExecMode_Closed:
//locker.Unlock();
while( m_ExecMode == ExecMode_Closed )
m_ResumeEvent.WaitRaw();