mysql\_thread\_init(3) MariaDB Connector/C mysql\_thread\_init(3)

## [Name](#Name)

mysql\_thread\_init - initialize thread

## [Synopsis](#Synopsis)

```
#include <mysql.h>
my_bool mysql_thread_init(void );
    
```

## [Description](#Description)

Thread initialization for multi threaded clients. Multi threaded clients should call mysql\_thread\_init() at the beginning of the thread initialization to initialize thread specific client library variables. If mysql\_thread\_init() was not called explicitly, it will be called automatically by [**mysql\_init(3)**](/man/os/mariadb-11.7/mysql_init.3) or [**mysql\_real\_connect(3)**](/man/os/mariadb-11.7/mysql_real_connect.3).

## [Notes](#Notes)

Before a client thread ends the [**mysql\_thread\_end(3)**](/man/os/mariadb-11.7/mysql_thread_end.3) function must be called to release memory - otherwise the client library will report an error.

## [Return value](#Return_value)

Returns zero if successful or 1 if an error occurred.

## [History](#History)

This function is deprecated since MariaDB Connector/C 3.0.0.

## [See also](#See_also)

•

[**mysql\_thread\_end(3)**](/man/os/mariadb-11.7/mysql_thread_end.3)

•

[**mysql\_thread\_safe(3)**](/man/os/mariadb-11.7/mysql_thread_safe.3)

Version 3.4

---

Document: mysql_thread_init(3) from mariadb-11.7 11.7.2-r5 (Chainguard OS)
