feat(Cmake/Database): separate database lib from common (#5334)

* feat(Core/Database): separate databse lib from common

* 1
This commit is contained in:
Kargatum
2021-04-20 17:08:23 +07:00
committed by GitHub
parent 47378ad14d
commit a278fd7340
39 changed files with 82 additions and 8 deletions

View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>
* 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, nullptr, nullptr);
}
static void Library_End()
{
mysql_library_end();
}
};
#endif