Bug #57791 Populating THR_thread_count through the new function

Submitted: 28 Oct 2010 7:12
Reporter: Bogdan Degtyariov Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S4 (Feature request)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: my_thread_global_end, threading

[28 Oct 2010 7:12] Bogdan Degtyariov
Description:
ODBC test suite, which we currently use for our ODBC drivers need some reliable way to make sure that no error like this will occur upon calling my_thread_global_end():

Error in my_thread_global_end(): 10 threads didn't exit

The client library has an internal variable THR_thread_count used as thread counter in my_thr_init.c. The variable is not accessible outside the module, where it is declared. So, there is no way to determine the number of client library initializations.

How to repeat:
Create few threads in C API applications and do not call mysql_thread_end().

Suggested fix:
Populate THR_thread_count through a new function mysql_get_thread_count() or something like this....
[28 Oct 2010 7:19] Ulf Wendel
+1 on using a function and no magic access to public struct members. Structs always bite us whenever we discuss plugins that work with mysqlnd and C/C.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.