diff options
author | unknown <knielsen@knielsen-hq.org> | 2012-01-06 12:43:18 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2012-01-06 12:43:18 +0100 |
commit | 17940b652d0a078f5a28b089aa0f5362756d438e (patch) | |
tree | 0c198251f33fd1b19ae2bb443a732496a3bf5ee3 /include/my_context.h | |
parent | a5b881594da4258257b18cc42f5ce7be3524e02c (diff) | |
download | mariadb-git-17940b652d0a078f5a28b089aa0f5362756d438e.tar.gz |
MWL#192: non-blocking client API, after-review fixes.
Main change is that non-blocking operation is now an option that must be
explicitly enabled with mysql_option(mysql, MYSQL_OPT_NONBLOCK, ...)
before any non-blocing operation can be used.
Also the CLIENT_REMEMBER_OPTIONS flag is now always enabled and thus
effectively ignored (it was not really useful anyway, and this simplifies
things when non-blocking mysql_real_connect() fails).
Diffstat (limited to 'include/my_context.h')
-rw-r--r-- | include/my_context.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/include/my_context.h b/include/my_context.h index e19ee89a8be..14974412075 100644 --- a/include/my_context.h +++ b/include/my_context.h @@ -1,17 +1,15 @@ /* - Copyright 2011 Kristian Nielsen + Copyright 2011 Kristian Nielsen and Monty Program Ab - Experiments with non-blocking libmysql. + This file is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. - This is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. You should have received a copy of the GNU General Public License along with this. If not, see <http://www.gnu.org/licenses/>. @@ -164,11 +162,14 @@ struct mysql_async_context { /* This is set to the value that should be returned from foo_start() or foo_cont() when a call is suspended. + */ + unsigned int events_to_wait_for; + /* It is also set to the event(s) that triggered when a suspended call is resumed, eg. whether we woke up due to connection completed or timeout in mysql_real_connect_cont(). */ - unsigned int ret_status; + unsigned int events_occured; /* This is set to the result of the whole asynchronous operation when it completes. It uses a union, as different calls have different return |