1 /*************************************************************************** 2 begin : Wed Feb 03 2021 3 copyright : (C) 2021 by Martin Preuss 4 email : martin@libchipcard.de 5 6 *************************************************************************** 7 * * 8 * This library is free software; you can redistribute it and/or * 9 * modify it under the terms of the GNU Lesser General Public * 10 * License as published by the Free Software Foundation; either * 11 * version 2.1 of the License, or (at your option) any later version. * 12 * * 13 * This library is distributed in the hope that it will be useful, * 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 16 * Lesser General Public License for more details. * 17 * * 18 * You should have received a copy of the GNU Lesser General Public * 19 * License along with this library; if not, write to the Free Software * 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 21 * MA 02111-1307 USA * 22 * * 23 ***************************************************************************/ 24 25 26 #ifndef GWEN_THREAD_H 27 #define GWEN_THREAD_H 28 29 30 #include <gwenhywfar/gwenhywfarapi.h> 31 #include <gwenhywfar/inherit.h> 32 #include <gwenhywfar/list1.h> 33 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 40 typedef struct GWEN_THREAD GWEN_THREAD; 41 GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_THREAD, GWENHYWFAR_API) 42 GWEN_LIST_FUNCTION_LIB_DEFS(GWEN_THREAD, GWEN_Thread, GWENHYWFAR_API) 43 44 45 typedef GWENHYWFAR_CB void (*GWEN_THREAD_RUN_FN)(GWEN_THREAD *thr); 46 47 48 49 GWENHYWFAR_API GWEN_THREAD *GWEN_Thread_new(); 50 GWENHYWFAR_API void GWEN_Thread_free(GWEN_THREAD *thr); 51 52 GWENHYWFAR_API int GWEN_Thread_Start(GWEN_THREAD *thr); 53 54 GWENHYWFAR_API int GWEN_Thread_Join(GWEN_THREAD *thr); 55 56 57 GWENHYWFAR_API GWEN_THREAD_RUN_FN GWEN_Thread_SetRunFn(GWEN_THREAD *thr, GWEN_THREAD_RUN_FN fn); 58 59 60 61 #ifdef __cplusplus 62 } 63 #endif 64 65 66 67 #endif 68 69