@@ -212,7 +212,7 @@ static void *nogvl_close(void *ptr) {
212
212
mysql_client_wrapper * wrapper ;
213
213
wrapper = ptr ;
214
214
if (wrapper -> connected ) {
215
- wrapper -> active_thread = Qnil ;
215
+ MARK_CONN_INACTIVE ( self ) ;
216
216
wrapper -> connected = 0 ;
217
217
#ifndef _WIN32
218
218
/* Invalidate the socket before calling mysql_close(). This prevents
@@ -256,7 +256,7 @@ static VALUE allocate(VALUE klass) {
256
256
mysql_client_wrapper * wrapper ;
257
257
obj = Data_Make_Struct (klass , mysql_client_wrapper , rb_mysql_client_mark , rb_mysql_client_free , wrapper );
258
258
wrapper -> encoding = Qnil ;
259
- wrapper -> active_thread = Qnil ;
259
+ MARK_CONN_INACTIVE ( self ) ;
260
260
wrapper -> server_version = 0 ;
261
261
wrapper -> reconnect_enabled = 0 ;
262
262
wrapper -> connect_timeout = 0 ;
@@ -412,7 +412,7 @@ static VALUE do_send_query(void *args) {
412
412
mysql_client_wrapper * wrapper = query_args -> wrapper ;
413
413
if ((VALUE )rb_thread_call_without_gvl (nogvl_send_query , args , RUBY_UBF_IO , 0 ) == Qfalse ) {
414
414
/* an error occurred, we're not active anymore */
415
- wrapper -> active_thread = Qnil ;
415
+ MARK_CONN_INACTIVE ( self ) ;
416
416
return rb_raise_mysql2_error (wrapper );
417
417
}
418
418
return Qnil ;
@@ -443,7 +443,7 @@ static void *nogvl_do_result(void *ptr, char use_result) {
443
443
444
444
/* once our result is stored off, this connection is
445
445
ready for another command to be issued */
446
- wrapper -> active_thread = Qnil ;
446
+ MARK_CONN_INACTIVE ( self ) ;
447
447
448
448
return result ;
449
449
}
@@ -512,7 +512,7 @@ struct async_query_args {
512
512
static VALUE disconnect_and_raise (VALUE self , VALUE error ) {
513
513
GET_CLIENT (self );
514
514
515
- wrapper -> active_thread = Qnil ;
515
+ MARK_CONN_INACTIVE ( self ) ;
516
516
wrapper -> connected = 0 ;
517
517
518
518
/* Invalidate the MySQL socket to prevent further communication.
@@ -588,7 +588,7 @@ static VALUE finish_and_mark_inactive(void *args) {
588
588
result = (MYSQL_RES * )rb_thread_call_without_gvl (nogvl_store_result , wrapper , RUBY_UBF_IO , 0 );
589
589
mysql_free_result (result );
590
590
591
- wrapper -> active_thread = Qnil ;
591
+ MARK_CONN_INACTIVE ( self ) ;
592
592
}
593
593
594
594
return Qnil ;
0 commit comments