2010-11-12 18:26:36 +08:00
|
|
|
#ifndef __PTHREAD_COND_H__
|
|
|
|
#define __PTHREAD_COND_H__
|
|
|
|
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <sys/time.h>
|
2010-11-15 08:25:37 +08:00
|
|
|
#include <rtthread.h>
|
2010-11-12 18:26:36 +08:00
|
|
|
|
|
|
|
struct pthread_cond
|
|
|
|
{
|
2010-11-15 08:25:37 +08:00
|
|
|
pthread_condattr_t attr;
|
|
|
|
struct rt_semaphore sem;
|
2010-11-12 18:26:36 +08:00
|
|
|
};
|
|
|
|
typedef struct pthread_cond pthread_cond_t;
|
|
|
|
|
2010-11-15 08:25:37 +08:00
|
|
|
int pthread_condattr_destroy(pthread_condattr_t *attr);
|
|
|
|
int pthread_condattr_init(pthread_condattr_t *attr);
|
|
|
|
|
|
|
|
/* ADVANCED REALTIME feature in IEEE Std 1003.1, 2004 Edition */
|
|
|
|
int pthread_condattr_getclock(const pthread_condattr_t *attr,
|
|
|
|
clockid_t *clock_id);
|
|
|
|
int pthread_condattr_setclock(pthread_condattr_t *attr,
|
|
|
|
clockid_t clock_id);
|
|
|
|
|
2010-11-12 18:26:36 +08:00
|
|
|
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);
|
|
|
|
int pthread_cond_destroy(pthread_cond_t *cond);
|
|
|
|
int pthread_cond_broadcast(pthread_cond_t *cond);
|
|
|
|
int pthread_cond_signal(pthread_cond_t *cond);
|
|
|
|
|
|
|
|
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
|
|
|
|
int pthread_cond_timedwait(pthread_cond_t *cond,
|
|
|
|
pthread_mutex_t * mutex,
|
|
|
|
const struct timespec *abstime);
|
|
|
|
|
|
|
|
#endif
|