diff options
author | Machiavelli <machiavelli.trinity@gmail.com> | 2011-01-13 21:30:37 +0100 |
---|---|---|
committer | Machiavelli <machiavelli.trinity@gmail.com> | 2011-01-13 21:30:37 +0100 |
commit | bd85914d92ccab255475dce9d4700abdc8428fb4 (patch) | |
tree | 6d8a41fdd0678ab31977c583c4987c348f401dec /src/server/shared/Database/MySQLThreading.h | |
parent | 4c15ebe09d51d22d98e314302652b66f345a56ff (diff) |
Core/DBLayer: Properly manage mysql library initialization and shutdown in authserver and worldserver. Prevent multiple calls and make it more elegant.
Diffstat (limited to 'src/server/shared/Database/MySQLThreading.h')
-rwxr-xr-x | src/server/shared/Database/MySQLThreading.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/server/shared/Database/MySQLThreading.h b/src/server/shared/Database/MySQLThreading.h index 40b524a2c44..33f24d9aba5 100755 --- a/src/server/shared/Database/MySQLThreading.h +++ b/src/server/shared/Database/MySQLThreading.h @@ -33,7 +33,7 @@ class MySQL static void Thread_Init() { mysql_thread_init(); - printf("Core thread with ID ["UI64FMTD"] initializing MySQL thread.\n", + sLog->outSQLDriver("Core thread with ID ["UI64FMTD"] initializing MySQL thread.", (uint64)ACE_Based::Thread::currentId()); } @@ -44,9 +44,19 @@ class MySQL static void Thread_End() { mysql_thread_end(); - printf("Core thread with ID ["UI64FMTD"] shutting down MySQL thread.\n", + sLog->outSQLDriver("Core thread with ID ["UI64FMTD"] shutting down MySQL thread.", (uint64)ACE_Based::Thread::currentId()); } + + static void Library_Init() + { + mysql_library_init(-1, NULL, NULL); + } + + static void Library_End() + { + mysql_library_end(); + } }; #endif
\ No newline at end of file |