Created
October 2, 2008 01:48
-
-
Save methodmissing/14252 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void schedule_query(VALUE obj, VALUE timeout) | |
| { | |
| MYSQL* m = GetHandler(obj); | |
| fd_set read; | |
| timeout = ( NIL_P(timeout) ? m->net.read_timeout : INT2NUM(timeout) ); | |
| struct timeval tv = { tv_sec: timeout, tv_usec: 0 }; | |
| FD_ZERO(&read); | |
| FD_SET(m->net.fd, &read); | |
| if (rb_thread_select(m->net.fd + 1, &read, NULL, NULL, &tv) < 0) { | |
| rb_raise(eMysql, "query: timeout"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment