diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2012-06-28 13:58:37 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2012-06-28 13:58:37 +0400 |
commit | c62c0c551684d063e51024579a4956f66048bbf5 (patch) | |
tree | 380b6d6d74e319732989a2cd8789482f6330e4f0 /sql/my_apc.cc | |
parent | 66c62de1034e780144e6945b3a2150253e2a652c (diff) | |
download | mariadb-git-c62c0c551684d063e51024579a4956f66048bbf5.tar.gz |
MWL#182: Explain running statements: address review feedback
- Add Monty Program Ab copyright in new files
- Change Apc_target::make_apc_call() to accept a C++-style
functor (instead of C-style function + parameter)
Diffstat (limited to 'sql/my_apc.cc')
-rw-r--r-- | sql/my_apc.cc | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/sql/my_apc.cc b/sql/my_apc.cc index eae2843edb4..212fbd0f6cb 100644 --- a/sql/my_apc.cc +++ b/sql/my_apc.cc @@ -1,6 +1,18 @@ /* - TODO: MP AB Copyright -*/ + Copyright (c) 2009, 2011, Monty Program Ab + + This program 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; version 2 of the License. + + This program 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef MY_APC_STANDALONE @@ -139,8 +151,8 @@ void Apc_target::dequeue_request(Call_request *qe) to use thd->enter_cond() calls to be killable) */ -bool Apc_target::make_apc_call(apc_func_t func, void *func_arg, - int timeout_sec, bool *timed_out) +bool Apc_target::make_apc_call(Apc_call *call, int timeout_sec, + bool *timed_out) { bool res= TRUE; *timed_out= FALSE; @@ -149,8 +161,7 @@ bool Apc_target::make_apc_call(apc_func_t func, void *func_arg, { /* Create and post the request */ Call_request apc_request; - apc_request.func= func; - apc_request.func_arg= func_arg; + apc_request.call= call; apc_request.processed= FALSE; mysql_cond_init(0 /* do not track in PS */, &apc_request.COND_request, NULL); enqueue_request(&apc_request); @@ -229,7 +240,7 @@ void Apc_target::process_apc_requests() dequeue_request(request); request->processed= TRUE; - request->func(request->func_arg); + request->call->call_in_target_thread(); request->what="func called by process_apc_requests"; #ifndef DBUG_OFF |