1/*
2 Copyright (c) 2009, 2011, Monty Program Ab
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
16
17#include <my_pthread.h>
18
19typedef struct st_ma_service_thread_control
20{
21 pthread_t thread;
22 my_bool killed;
23 /** if thread module was inited or not */
24 my_bool inited;
25 /** for killing the background thread */
26 mysql_mutex_t *LOCK_control;
27 /** for killing the background thread */
28 mysql_cond_t *COND_control;
29} MA_SERVICE_THREAD_CONTROL;
30
31
32int ma_service_thread_control_init(MA_SERVICE_THREAD_CONTROL *control);
33void ma_service_thread_control_end(MA_SERVICE_THREAD_CONTROL *control);
34my_bool my_service_thread_sleep(MA_SERVICE_THREAD_CONTROL *control,
35 ulonglong sleep_time);
36