aboutsummaryrefslogtreecommitdiff
path: root/guilib/GUIWindowManager.cpp
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2009-10-24 07:18:07 +0000
committerjmarshallnz <jmarshallnz@svn>2009-10-24 07:18:07 +0000
commitfe912694d7a286eb4fb17142d705de5725ca3711 (patch)
tree9ddd3fb4383c66834681e86d80add921d3026adb /guilib/GUIWindowManager.cpp
parent134e122785f2daa7cfcfad6763186a9ac5c40324 (diff)
changed: Use CCriticalSection/CSingleLock rather than EnterCriticalSection etc. in the windowmanager.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23961 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIWindowManager.cpp')
-rw-r--r--guilib/GUIWindowManager.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/guilib/GUIWindowManager.cpp b/guilib/GUIWindowManager.cpp
index 5a24e5115d..7a169a61db 100644
--- a/guilib/GUIWindowManager.cpp
+++ b/guilib/GUIWindowManager.cpp
@@ -25,6 +25,7 @@
#include "Application.h"
#include "GUIPassword.h"
#include "utils/GUIInfoManager.h"
+#include "utils/SingleLock.h"
#include "Util.h"
#include "GUISettings.h"
#include "Settings.h"
@@ -35,15 +36,12 @@ CGUIWindowManager g_windowManager;
CGUIWindowManager::CGUIWindowManager(void)
{
- InitializeCriticalSection(&m_critSection);
-
m_pCallback = NULL;
m_bShowOverlay = true;
}
CGUIWindowManager::~CGUIWindowManager(void)
{
- DeleteCriticalSection(&m_critSection);
}
void CGUIWindowManager::Initialize()
@@ -641,30 +639,26 @@ int CGUIWindowManager::GetTopMostModalDialogID() const
void CGUIWindowManager::SendThreadMessage(CGUIMessage& message)
{
- ::EnterCriticalSection(&m_critSection );
+ CSingleLock lock(m_critSection);
CGUIMessage* msg = new CGUIMessage(message);
m_vecThreadMessages.push_back( pair<CGUIMessage*,int>(msg,0) );
-
- ::LeaveCriticalSection(&m_critSection );
}
void CGUIWindowManager::SendThreadMessage(CGUIMessage& message, int window)
{
- ::EnterCriticalSection(&m_critSection );
+ CSingleLock(m_critSection);
CGUIMessage* msg = new CGUIMessage(message);
m_vecThreadMessages.push_back( pair<CGUIMessage*,int>(msg,window) );
-
- ::LeaveCriticalSection(&m_critSection );
}
void CGUIWindowManager::DispatchThreadMessages()
{
- ::EnterCriticalSection(&m_critSection );
+ CSingleLock(m_critSection);
vector< pair<CGUIMessage*,int> > messages(m_vecThreadMessages);
m_vecThreadMessages.erase(m_vecThreadMessages.begin(), m_vecThreadMessages.end());
- ::LeaveCriticalSection(&m_critSection );
+ m_critSection.Leave();
while ( messages.size() > 0 )
{