00001 /* Copyright (C) 2003 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 #ifndef NDB_THREAD_H 00018 #define NDB_THREAD_H 00019 00020 #include <ndb_global.h> 00021 00022 #ifdef __cplusplus 00023 extern "C" { 00024 #endif 00025 00026 typedef enum NDB_THREAD_PRIO_ENUM { 00027 NDB_THREAD_PRIO_HIGHEST, 00028 NDB_THREAD_PRIO_HIGH, 00029 NDB_THREAD_PRIO_MEAN, 00030 NDB_THREAD_PRIO_LOW, 00031 NDB_THREAD_PRIO_LOWEST 00032 } NDB_THREAD_PRIO; 00033 00034 typedef void* (NDB_THREAD_FUNC)(void*); 00035 typedef void* NDB_THREAD_ARG; 00036 typedef size_t NDB_THREAD_STACKSIZE; 00037 00038 struct NdbThread; 00039 00049 struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, 00050 NDB_THREAD_ARG *p_thread_arg, 00051 const NDB_THREAD_STACKSIZE thread_stack_size, 00052 const char* p_thread_name, 00053 NDB_THREAD_PRIO thread_prio); 00054 00061 void NdbThread_Destroy(struct NdbThread** p_thread); 00062 00063 00072 int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status); 00073 00079 void NdbThread_Exit(void *status); 00080 00086 int NdbThread_SetConcurrencyLevel(int level); 00087 00088 00089 #ifdef __cplusplus 00090 } 00091 #endif 00092 00093 #endif 00094 00095 00096 00097 00098 00099 00100 00101 00102
1.4.3