#ifndef __THREAD_Hx__ #define __THREAD_Hx__ #include #include #ifdef __cplusplus extern "C" { #endif #define KB 1024 #define MB (1024*1024) enum { THREAD_ID_IO=0, THREAD_ID_WS, THREAD_ID_WEB, THREAD_ID_NTP, THREAD_ID_SNMP, THREAD_ID_POWER, THREAD_ID_SENSOR, THREAD_ID_PLUG, THREAD_ID_CASCADE, THREAD_ID_SCAN, THREAD_ID_SHMW, THREAD_ID_BREAKER, THREAD_ID_SWITCH, THREAD_ID_MAX=30 }; typedef void *(*thread_fn)(void *arg); typedef struct { pthread_t tid; int quit; void *arg; thread_fn fn; }thread_handle_t; int thread_start(int id, thread_fn fn, void *arg, int stksize, int prio); int thread_stop(int id); int thread_stop_all(void); int thread_start_simp(thread_fn fn, void *arg, int stksize); int thread_print_stacksize(void); #ifdef __cplusplus } #endif #endif