Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  7
Language: C/C++
Code:
/* simple thread pool, XXX:windows only/volume contraction lack *.*/

#if !defined (___THREADSET_17901_CC)
#  define ___THREADSET_17901_CC

#if defined (__cplusplus)
extern "C" {
#endif 

typedef void *threadset_t;
typedef void *thread_t;

enum thread_attr {
  THREAD_DETACH,
  THREAD_JOIN
};

int threadset_init (threadset_t* TS, int thread_nums);
int threadset_uninit (threadset_t* TS);

int threadset_addwork (threadset_t TS, enum thread_attr attr, thread_t *accept, int (/* __cdecl*/*  routine)(void *param), void *param);
int thread_join (thread_t T);

#if defined (__cplusplus)
}
#endif 

#endif 
Comments: