2017-05-17 14:18:01 +00:00
|
|
|
#ifndef MM_THREAD_POOL_H_
|
|
|
|
#define MM_THREAD_POOL_H_
|
|
|
|
|
|
|
|
/*
|
|
|
|
* machinarium.
|
|
|
|
*
|
|
|
|
* cooperative multitasking engine.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct mm_thread_t mm_thread_t;
|
|
|
|
|
|
|
|
typedef void *(*mm_thread_function_t)(void*);
|
|
|
|
|
|
|
|
struct mm_thread_t {
|
|
|
|
pthread_t id;
|
|
|
|
mm_thread_function_t function;
|
|
|
|
void *arg;
|
|
|
|
};
|
|
|
|
|
|
|
|
int mm_thread_create(mm_thread_t*, mm_thread_function_t, void*);
|
|
|
|
int mm_thread_join(mm_thread_t*);
|
2017-05-17 14:35:55 +00:00
|
|
|
int mm_thread_set_name(mm_thread_t*, char*);
|
2017-05-17 14:18:01 +00:00
|
|
|
|
|
|
|
#endif
|