From aaded4ec6d793395b883d456f23ffebf43689bd1 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 7 May 2010 09:55:30 +0000 Subject: [PATCH] Mess with Jake's code until it works in Linux. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2961 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Utilities/ScopedPtr.h | 2 +- common/include/Utilities/ScopedPtrMT.h | 5 +++-- common/src/Utilities/CMakeLists.txt | 1 + pcsx2/gui/AppCorePlugins.cpp | 17 +++++++++++------ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/common/include/Utilities/ScopedPtr.h b/common/include/Utilities/ScopedPtr.h index 2a218259b9..8332cb8842 100644 --- a/common/include/Utilities/ScopedPtr.h +++ b/common/include/Utilities/ScopedPtr.h @@ -149,7 +149,7 @@ protected: public: typedef T element_type; - wxEXPLICIT ScopedArray(T * ptr = NULL) : + wxEXPLICIT ScopedArray(T * ptr = NULL) { m_array = ptr; m_valid_range = 0xffffffff; diff --git a/common/include/Utilities/ScopedPtrMT.h b/common/include/Utilities/ScopedPtrMT.h index 89bd3012a5..e65ecce393 100644 --- a/common/include/Utilities/ScopedPtrMT.h +++ b/common/include/Utilities/ScopedPtrMT.h @@ -15,7 +15,8 @@ #pragma once -#include "Threading.h" +#include "Threading.h" +using Threading::ScopedLock; // -------------------------------------------------------------------------------------- // ScopedPtrMT @@ -44,7 +45,7 @@ public: ScopedPtrMT& Reassign(T * ptr = NULL) { - TPtr doh = (TPtr)AtomicExchangePointer( m_ptr, ptr ); + TPtr doh = (TPtr)Threading::AtomicExchangePointer( m_ptr, ptr ); if ( ptr != doh ) delete doh; return *this; } diff --git a/common/src/Utilities/CMakeLists.txt b/common/src/Utilities/CMakeLists.txt index 20492651fd..b0d953ca6d 100644 --- a/common/src/Utilities/CMakeLists.txt +++ b/common/src/Utilities/CMakeLists.txt @@ -154,6 +154,7 @@ set(UtilitiesHeaders ../../include/Utilities/RedtapeWindows.h ../../include/Utilities/SafeArray.h ../../include/Utilities/ScopedPtr.h + ../../include/Utilities/ScopedPtrMT.h ../../include/Utilities/StringHelpers.h ../../include/Utilities/Threading.h ../../include/Utilities/ThreadingDialogs.h diff --git a/pcsx2/gui/AppCorePlugins.cpp b/pcsx2/gui/AppCorePlugins.cpp index 581fcc20bf..94d661a433 100644 --- a/pcsx2/gui/AppCorePlugins.cpp +++ b/pcsx2/gui/AppCorePlugins.cpp @@ -166,7 +166,7 @@ public: m_pid = pid; m_method = method; } - + protected: void InvokeEvent() { @@ -203,10 +203,11 @@ AppPluginManager::~AppPluginManager() throw() } void AppPluginManager::Load( PluginsEnum_t pid, const wxString& srcfile ) -{ +{ if( !wxThread::IsMain() ) { - wxGetApp().ProcessAction( LoadSinglePluginEvent( pid, srcfile ) ); + LoadSinglePluginEvent evt( pid, srcfile ); + wxGetApp().ProcessAction( evt); Sleep( 5 ); return; } @@ -218,7 +219,8 @@ void AppPluginManager::Unload( PluginsEnum_t pid ) { if( !wxThread::IsMain() ) { - wxGetApp().ProcessAction( SinglePluginMethodEvent( &AppPluginManager::Unload, pid ) ); + SinglePluginMethodEvent evt( &AppPluginManager::Unload, pid ); + wxGetApp().ProcessAction( evt ); Sleep( 5 ); return; } @@ -245,7 +247,9 @@ void AppPluginManager::Init( PluginsEnum_t pid ) { if( !wxThread::IsMain() ) { - wxGetApp().ProcessAction( SinglePluginMethodEvent( &AppPluginManager::Init, pid ) ); + //pxInvokeActionEvent& evt = SinglePluginMethodEvent( &AppPluginManager::Init, pid ); + SinglePluginMethodEvent evt(&AppPluginManager::Init, pid); + wxGetApp().ProcessAction( evt ); Sleep( 5 ); return; } @@ -257,7 +261,8 @@ void AppPluginManager::Shutdown( PluginsEnum_t pid ) { if( !wxThread::IsMain() ) { - wxGetApp().ProcessAction( SinglePluginMethodEvent( &AppPluginManager::Shutdown, pid ) ); + SinglePluginMethodEvent evt( &AppPluginManager::Shutdown, pid ); + wxGetApp().ProcessAction( evt ); Sleep( 5 ); return; }