6 messages in com.mysql.lists.win32RE: Is the mysql C API thread safe?
FromSent OnAttachments
Ralf Hupfer17 Dec 2002 03:27 
oceanare pte ltd17 Dec 2002 04:49 
Ralf Hupfer17 Dec 2002 06:27 
Ralf Hupfer17 Dec 2002 06:31 
oceanare pte ltd17 Dec 2002 07:05 
miguel solórzano17 Dec 2002 08:02 
Subject:RE: Is the mysql C API thread safe?
From:miguel solórzano (mig@mysql.com)
Date:12/17/2002 08:02:54 AM
List:com.mysql.lists.win32

At 15:31 17/12/2002 +0100, Ralf Hupfer wrote: Hi,

As you stated, you have to use mysql_thread_start and mysql_thread_end plus a critical section to protect mysql_real_connect. At the end of my programs I call my_end.

The commands mysql_thread_init() and mysql_thread_end() are not defined in the Windows version of the client C API.

Take a look in the source of 4.0.X:

/include/config-win.h

--125-- #ifndef UNDEF_THREAD_HACK #define THREAD #endif

/libmysql;libmysql.c

--112--

my_bool STDCALL mysql_thread_init() { #ifdef THREAD return my_thread_init(); #else return 0; #endif } void STDCALL mysql_thread_end() { #ifdef THREAD my_thread_end(); #endif }