| 35 | } |
| 36 | |
| 37 | int MysqlInit() |
| 38 | { |
| 39 | dbg_assert(mysql_thread_safe(), "MySQL library without thread safety"); |
| 40 | dbg_assert(g_MysqlState == MYSQLSTATE_UNINITIALIZED, "double MySQL initialization"); |
| 41 | if(mysql_library_init(0, nullptr, nullptr)) |
| 42 | { |
| 43 | return 1; |
| 44 | } |
| 45 | int Uninitialized = MYSQLSTATE_UNINITIALIZED; |
| 46 | bool Swapped = g_MysqlState.compare_exchange_strong(Uninitialized, MYSQLSTATE_INITIALIZED); |
| 47 | (void)Swapped; |
| 48 | dbg_assert(Swapped, "MySQL double initialization"); |
| 49 | return 0; |
| 50 | } |
| 51 | |
| 52 | void MysqlUninit() |
| 53 | { |
no outgoing calls
no test coverage detected