Skip to content

Commit

Permalink
Conditional schedule cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
methodmissing committed Oct 31, 2008
1 parent 4640893 commit 57712a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand All @@ -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);
}

Expand Down

0 comments on commit 57712a6

Please sign in to comment.