「eosPThread(API)」の版間の差分

提供: Eospedia
移動: 案内検索
(ページの作成:「General/'''eosPThread'''はAPI です。 == 定数 == extern int __eosPThread__; extern int __eosPThreadNum__; == 構造体 == typedef enum eosPThreadStatus { eosP...」)
 
行2: 行2:
  
 
== 定数 ==
 
== 定数 ==
extern int __eosPThread__;
 
extern int __eosPThreadNum__;
 
 
== 構造体 ==
 
 
  typedef enum eosPThreadStatus {
 
  typedef enum eosPThreadStatus {
 
  eosPThreadStatusWaiting = 0,
 
  eosPThreadStatusWaiting = 0,
 
  eosPThreadStatusRunning = 1
 
  eosPThreadStatusRunning = 1
 
  } eosPThreadStatus;
 
  } eosPThreadStatus;
 +
 +
== 構造体 ==
 +
extern int __eosPThread__;
 +
extern int __eosPThreadNum__;
  
 
  typedef struct eosPThread {
 
  typedef struct eosPThread {

2014年5月20日 (火) 08:28時点における版

General/eosPThreadはAPI です。

定数

typedef enum eosPThreadStatus {
	eosPThreadStatusWaiting = 0,
	eosPThreadStatusRunning = 1
} eosPThreadStatus;

構造体

extern int __eosPThread__;
extern int __eosPThreadNum__;
typedef struct eosPThread {
	pthread_t* 			th;         /* [max] thread */
	eosPThreadStatus* 	status;     /* [max] thread status */
	long*				id;         /* [max] thread ID indicated by count */

	int 				max;		/* maximum thread number working simultaneously. */ 
	long				count;		/* count of created threads */	 
	long				latest;     /* working thread ID which started latest */
	long				oldest;     /* working thread ID which started oldest */

	pthread_mutex_t     mutex;
	pthread_mutexattr_t mutex_attr;
} eosPThread;

API

extern void eosPThreadInit   (eosPThread* t, int max, int mode);
extern int  eosPThreadCreateOnWaitingThread (eosPThread* t, void* (*start_routine)(void *), void * arg, int mode);
extern int  eosPThreadCreate (eosPThread* t, int i, void* (*start_routine)(void *), void * arg, int mode);
extern void eosPThreadJoin   (eosPThread* t, int i, int mode);
extern void eosPThreadJoinAll(eosPThread* t, int mode);
extern void eosPThreadMutexInit(eosPThread* t);
extern void eosPThreadMutexDestroy(eosPThread* t);
extern void eosPThreadMutexLock(eosPThread* t);
extern void eosPThreadMutexUnlock(eosPThread* t);