@@ -259,7 +259,7 @@ static VALUE allocate(VALUE klass) {
259
259
mysql_client_wrapper * wrapper ;
260
260
obj = Data_Make_Struct (klass , mysql_client_wrapper , rb_mysql_client_mark , rb_mysql_client_free , wrapper );
261
261
wrapper -> encoding = Qnil ;
262
- MARK_CONN_INACTIVE ( wrapper ) ;
262
+ wrapper -> active_thread = Qnil ;
263
263
wrapper -> automatic_close = 1 ;
264
264
wrapper -> server_version = 0 ;
265
265
wrapper -> reconnect_enabled = 0 ;
@@ -418,7 +418,7 @@ static VALUE do_send_query(void *args) {
418
418
mysql_client_wrapper * wrapper = query_args -> wrapper ;
419
419
if ((VALUE )rb_thread_call_without_gvl (nogvl_send_query , args , RUBY_UBF_IO , 0 ) == Qfalse ) {
420
420
/* an error occurred, we're not active anymore */
421
- MARK_CONN_INACTIVE ( wrapper ) ;
421
+ wrapper -> active_thread = Qnil ;
422
422
return rb_raise_mysql2_error (wrapper );
423
423
}
424
424
return Qnil ;
@@ -448,7 +448,7 @@ static void *nogvl_do_result(void *ptr, char use_result) {
448
448
449
449
/* once our result is stored off, this connection is
450
450
ready for another command to be issued */
451
- MARK_CONN_INACTIVE ( wrapper ) ;
451
+ wrapper -> active_thread = Qnil ;
452
452
453
453
return result ;
454
454
}
@@ -480,7 +480,7 @@ static VALUE rb_mysql_client_async_result(VALUE self) {
480
480
REQUIRE_CONNECTED (wrapper );
481
481
if ((VALUE )rb_thread_call_without_gvl (nogvl_read_query_result , wrapper -> client , RUBY_UBF_IO , 0 ) == Qfalse ) {
482
482
/* an error occurred, mark this connection inactive */
483
- MARK_CONN_INACTIVE ( wrapper ) ;
483
+ wrapper -> active_thread = Qnil ;
484
484
return rb_raise_mysql2_error (wrapper );
485
485
}
486
486
@@ -493,7 +493,7 @@ static VALUE rb_mysql_client_async_result(VALUE self) {
493
493
494
494
if (result == NULL ) {
495
495
if (mysql_errno (wrapper -> client ) != 0 ) {
496
- MARK_CONN_INACTIVE ( wrapper ) ;
496
+ wrapper -> active_thread = Qnil ;
497
497
rb_raise_mysql2_error (wrapper );
498
498
}
499
499
/* no data and no error, so query was not a SELECT */
@@ -517,7 +517,7 @@ struct async_query_args {
517
517
static VALUE disconnect_and_raise (VALUE self , VALUE error ) {
518
518
GET_CLIENT (self );
519
519
520
- MARK_CONN_INACTIVE ( wrapper ) ;
520
+ wrapper -> active_thread = Qnil ;
521
521
wrapper -> connected = 0 ;
522
522
523
523
/* 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
- MARK_CONN_INACTIVE ( wrapper ) ;
591
+ wrapper -> active_thread = Qnil ;
592
592
}
593
593
594
594
return Qnil ;
0 commit comments