aligned_stack: synced with trunk, to bring in the new console code for additional testing under a (properly working!) linux.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/aligned_stack@2046 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine
2009-10-21 01:25:55 +00:00
40 changed files with 553 additions and 417 deletions
+10 -15
View File
@@ -144,8 +144,6 @@ void Threading::PersistentThread::Start()
if( pthread_create( &m_thread, NULL, _internal_callback, this ) != 0 )
throw Exception::ThreadCreationError();
m_detached = false;
}
// Returns: TRUE if the detachment was performed, or FALSE if the thread was
@@ -384,7 +382,8 @@ wxString Threading::PersistentThread::GetName() const
// private member, and provide a new Task executor by a different name).
void Threading::PersistentThread::OnStartInThread()
{
m_running = true;
m_running = true;
m_detached = false;
}
void Threading::PersistentThread::_internal_execute()
@@ -426,7 +425,7 @@ void Threading::PersistentThread::_DoSetThreadName( const wxString& name )
_DoSetThreadName( name.ToUTF8() );
}
void Threading::PersistentThread::_DoSetThreadName( __unused const char* name )
void Threading::PersistentThread::_DoSetThreadName( const char* name )
{
pxAssertMsg( IsSelf(), "Thread affinity error." ); // only allowed from our own thread, thanks.
@@ -435,7 +434,7 @@ void Threading::PersistentThread::_DoSetThreadName( __unused const char* name )
#if defined(_WINDOWS_) && defined (_MSC_VER)
// This code sample was borrowed form some obscure MSDN article.
// In a rare bout of sanity, it's an actual Micrsoft-published hack
// In a rare bout of sanity, it's an actual Microsoft-published hack
// that actually works!
static const int MS_VC_EXCEPTION = 0x406D1388;
@@ -443,10 +442,10 @@ void Threading::PersistentThread::_DoSetThreadName( __unused const char* name )
#pragma pack(push,8)
struct THREADNAME_INFO
{
DWORD dwType; // Must be 0x1000.
LPCSTR szName; // Pointer to name (in user addr space).
DWORD dwThreadID; // Thread ID (-1=caller thread).
DWORD dwFlags; // Reserved for future use, must be zero.
DWORD dwType; // Must be 0x1000.
LPCSTR szName; // Pointer to name (in user addr space).
DWORD dwThreadID; // Thread ID (-1=caller thread).
DWORD dwFlags; // Reserved for future use, must be zero.
};
#pragma pack(pop)
@@ -456,13 +455,9 @@ void Threading::PersistentThread::_DoSetThreadName( __unused const char* name )
info.dwThreadID = GetCurrentThreadId();
info.dwFlags = 0;
__try
{
__try {
RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
}
} __except(EXCEPTION_EXECUTE_HANDLER) { }
#endif
}