Skip to content

Commit

Permalink
[9265] * Call Database::ThreadStart()/ThreadEnd() for all DBs.
Browse files Browse the repository at this point in the history
  • Loading branch information
XTZGZoReX committed Jan 29, 2010
1 parent 184f565 commit af146f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/game/WorldSocketMgr.cpp
Expand Up @@ -152,7 +152,9 @@ class ReactorRunnable : protected ACE_Task_Base
{
DEBUG_LOG ("Network Thread Starting");

WorldDatabase.ThreadStart ();
WorldDatabase.ThreadStart();
CharacterDatabase.ThreadStart();
loginDatabase.ThreadStart();

ACE_ASSERT (m_Reactor);

Expand Down Expand Up @@ -185,7 +187,9 @@ class ReactorRunnable : protected ACE_Task_Base
}
}

WorldDatabase.ThreadEnd ();
WorldDatabase.ThreadEnd();
CharacterDatabase.ThreadEnd();
loginDatabase.ThreadEnd();

DEBUG_LOG ("Network Thread Exitting");

Expand Down
4 changes: 4 additions & 0 deletions src/mangosd/CliRunnable.cpp
Expand Up @@ -294,6 +294,8 @@ void CliRunnable::run()
{
///- Init new SQL thread for the world database (one connection call enough)
WorldDatabase.ThreadStart(); // let thread do safe mySQL requests
CharacterDatabase.ThreadStart();
loginDatabase.ThreadStart();

char commandbuf[256];

Expand Down Expand Up @@ -352,4 +354,6 @@ void CliRunnable::run()

///- End the database thread
WorldDatabase.ThreadEnd(); // free mySQL thread resources
CharacterDatabase.ThreadEnd();
loginDatabase.ThreadEnd();
}
5 changes: 5 additions & 0 deletions src/mangosd/WorldRunnable.cpp
Expand Up @@ -42,6 +42,9 @@ void WorldRunnable::run()
{
///- Init new SQL thread for the world database
WorldDatabase.ThreadStart(); // let thread do safe mySQL requests (one connection call enough)
CharacterDatabase.ThreadStart();
loginDatabase.ThreadStart();

sWorld.InitResultQueue();

uint32 realCurrTime = 0;
Expand Down Expand Up @@ -90,4 +93,6 @@ void WorldRunnable::run()

///- End the database thread
WorldDatabase.ThreadEnd(); // free mySQL thread resources
CharacterDatabase.ThreadEnd();
loginDatabase.ThreadEnd();
}
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9264"
#define REVISION_NR "9265"
#endif // __REVISION_NR_H__

2 comments on commit af146f1

@Omeprazol
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not common with comunicatin with external apps. does that mean that at last there will be availeble multiple sql query queuing (multiple requests will be hadled at the same time via more than one connection)?

@digitalni
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By looking at the code, it seems so. Wonderful indeed.

Please sign in to comment.