mysql_thread_id — Returns the thread id for the current connection
unsigned long mysql_thread_id(MYSQL * mysql);The mysql_thread_id() function returns the thread id for the current connection.
mysqlA mysql handle, which was previously allocated by mysql_init() or mysql_real_connect().