mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-09-25 22:15:48 +02:00
wxgui: Moved some more files around in Common/Utilities, and merged against trunk.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1460 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
@@ -38,6 +38,7 @@ namespace Threading
|
||||
|
||||
void Thread::Start()
|
||||
{
|
||||
m_terminated = false;
|
||||
if( pthread_create( &m_thread, NULL, _internal_callback, this ) != 0 )
|
||||
throw Exception::ThreadCreationError();
|
||||
}
|
||||
@@ -135,6 +136,26 @@ namespace Threading
|
||||
err = pthread_mutex_init( &mutex, NULL );
|
||||
}
|
||||
|
||||
MutexLock::MutexLock( bool isRecursive )
|
||||
{
|
||||
if( isRecursive )
|
||||
{
|
||||
pthread_mutexattr_t mutexAttribute;
|
||||
int status = pthread_mutexattr_init( &mutexAttribute );
|
||||
if (status != 0) { /* ... */ }
|
||||
status = pthread_mutexattr_settype( &mutexAttribute, PTHREAD_MUTEX_RECURSIVE);
|
||||
if (status != 0) { /* ... */}
|
||||
|
||||
int err = 0;
|
||||
err = pthread_mutex_init( &mutex, &mutexAttribute );
|
||||
}
|
||||
else
|
||||
{
|
||||
int err = 0;
|
||||
err = pthread_mutex_init( &mutex, NULL );
|
||||
}
|
||||
}
|
||||
|
||||
MutexLock::~MutexLock()
|
||||
{
|
||||
pthread_mutex_destroy( &mutex );
|
||||
|
||||
Reference in New Issue
Block a user