The world's most popular open source database
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 00040 /* 00041 Method to block/unblock thread from receiving KILL signal with 00042 signum set in g_ndb_shm_signum in a portable manner. 00043 */ 00044 #ifdef NDB_SHM_TRANSPORTER 00045 void NdbThread_set_shm_sigmask(bool block); 00046 #endif 00047 00057 struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, 00058 NDB_THREAD_ARG *p_thread_arg, 00059 const NDB_THREAD_STACKSIZE thread_stack_size, 00060 const char* p_thread_name, 00061 NDB_THREAD_PRIO thread_prio); 00062 00069 void NdbThread_Destroy(struct NdbThread** p_thread); 00070 00071 00080 int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status); 00081 00087 void NdbThread_Exit(void *status); 00088 00094 int NdbThread_SetConcurrencyLevel(int level); 00095 00096 00097 #ifdef __cplusplus 00098 } 00099 #endif 00100 00101 #endif 00102 00103 00104 00105 00106 00107 00108 00109 00110
1.4.7

