John McCaskey wrote:

void *mysql_thread(void *arg) {
>
        mysql_thread_init();


        pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,&cancelstate);

        
        //regular mysql code and whatever else here
//use mysql_real_connect and mysql_real_query //and whatever without worrying about thread safety


        pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,&cancelstate)



      mysql_thread_end();
}

Shouldn't this be like that? I have had random core dumps without
the setcancelstate recently in case of database failures and back
tracing it was really messy. Actually, the setcancelstate should
be around any IO routines to and from the database (mysql_real_
query, mysql_real_connect) within your threads.

Lefteris

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to