summaryrefslogtreecommitdiff
path: root/src/core/Database/MySQLThreading.h
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2017-10-12 20:00:52 +0200
committerYehonal <yehonal.azeroth@gmail.com>2017-10-12 20:00:52 +0200
commitf06f32849f1e2c72dc73287c73361174c07ed29e (patch)
tree70ace68e849cd5ca446fb36279f8125127bb8693 /src/core/Database/MySQLThreading.h
parent4df28fd29c6978e669f9950bd38e853fabf9fc8d (diff)
Directory Structure [step 1]: moving files
working on #672 NOTE: This commit can't be compiled!!
Diffstat (limited to 'src/core/Database/MySQLThreading.h')
-rw-r--r--src/core/Database/MySQLThreading.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/core/Database/MySQLThreading.h b/src/core/Database/MySQLThreading.h
new file mode 100644
index 0000000000..726fd7cb81
--- /dev/null
+++ b/src/core/Database/MySQLThreading.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C)
+ *
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ */
+
+#ifndef _MYSQLTHREADING_H
+#define _MYSQLTHREADING_H
+
+#include "Log.h"
+
+class MySQL
+{
+ public:
+ /*! Create a thread on the MySQL server to mirrior the calling thread,
+ initializes thread-specific variables and allows thread-specific
+ operations without concurrence from other threads.
+ This should only be called if multiple core threads are running
+ on the same MySQL connection. Seperate MySQL connections implicitly
+ create a mirror thread.
+ */
+ static void Thread_Init()
+ {
+ mysql_thread_init();
+ }
+
+ /*! Shuts down MySQL thread and frees resources, should only be called
+ when we terminate. MySQL threads and connections are not configurable
+ during runtime.
+ */
+ static void Thread_End()
+ {
+ mysql_thread_end();
+ }
+
+ static void Library_Init()
+ {
+ mysql_library_init(-1, NULL, NULL);
+ }
+
+ static void Library_End()
+ {
+ mysql_library_end();
+ }
+};
+
+#endif