From 57712a64e67d30277978808e128f40cc251fa8ea Mon Sep 17 00:00:00 2001 From: Lourens Naude Date: Fri, 31 Oct 2008 15:48:28 +0000 Subject: [PATCH] Conditional schedule cleanup --- ext/mysql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/mysql.c b/ext/mysql.c index 98656b8..84375c0 100644 --- a/ext/mysql.c +++ b/ext/mysql.c @@ -1035,7 +1035,7 @@ static void schedule_query(VALUE obj, VALUE timeout) } static int should_schedule_query(){ - return ( ( rb_thread_main() == rb_thread_current() ) && rb_thread_alone() ); + return ( ( rb_thread_main() == rb_thread_current() ) && rb_thread_alone() ) != 1; } /* async_query(sql,timeout=nil) */ @@ -1052,7 +1052,7 @@ static VALUE async_query(int argc, VALUE* argv, VALUE obj) send_query( obj, sql ); - if ( should_schedule_query() != 1 ){ + if ( should_schedule_query() ){ schedule_query(obj, timeout); }