blind fix to let wxDB compile in debug without threads

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48685 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-09-14 19:02:28 +00:00
parent 24ba0ff2cb
commit 418f27dbeb
2 changed files with 10 additions and 0 deletions

View File

@@ -65,7 +65,9 @@ wxChar const *SQL_CATALOG_FILENAME = wxT("catalog.txt");
#include "wx/thread.h" #include "wx/thread.h"
extern wxList TablesInUse; extern wxList TablesInUse;
#if wxUSE_THREADS
extern wxCriticalSection csTablesInUse; extern wxCriticalSection csTablesInUse;
#endif // wxUSE_THREADS
#endif #endif
// SQL Log defaults to be used by GetDbConnection // SQL Log defaults to be used by GetDbConnection
@@ -1750,7 +1752,9 @@ void wxDb::Close(void)
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
{ {
#if wxUSE_THREADS
wxCriticalSectionLocker lock(csTablesInUse); wxCriticalSectionLocker lock(csTablesInUse);
#endif // wxUSE_THREADS
wxTablesInUse *tiu; wxTablesInUse *tiu;
wxList::compatibility_iterator pNode; wxList::compatibility_iterator pNode;
pNode = TablesInUse.GetFirst(); pNode = TablesInUse.GetFirst();

View File

@@ -62,7 +62,9 @@ ULONG lastTableID = 0;
#include "wx/thread.h" #include "wx/thread.h"
wxList TablesInUse; wxList TablesInUse;
#if wxUSE_THREADS
wxCriticalSection csTablesInUse; wxCriticalSection csTablesInUse;
#endif // wxUSE_THREADS
#endif #endif
@@ -199,7 +201,9 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num
tableInUse->tableID = tableID; tableInUse->tableID = tableID;
tableInUse->pDb = pDb; tableInUse->pDb = pDb;
{ {
#if wxUSE_THREADS
wxCriticalSectionLocker lock(csTablesInUse); wxCriticalSectionLocker lock(csTablesInUse);
#endif // wxUSE_THREADS
TablesInUse.Append(tableInUse); TablesInUse.Append(tableInUse);
} }
#endif #endif
@@ -328,7 +332,9 @@ void wxDbTable::cleanup()
wxList::compatibility_iterator pNode; wxList::compatibility_iterator pNode;
{ {
#if wxUSE_THREADS
wxCriticalSectionLocker lock(csTablesInUse); wxCriticalSectionLocker lock(csTablesInUse);
#endif // wxUSE_THREADS
pNode = TablesInUse.GetFirst(); pNode = TablesInUse.GetFirst();
while (!found && pNode) while (!found && pNode)
{ {