add initial pthread implementation.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1044 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong
2010-11-12 10:26:36 +00:00
parent 7018ab0661
commit 25f50375ef
19 changed files with 1179 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
#include "pthread_cond.h"
int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared)
{
if (!attr || !pshared) return EINVAL;
*pshared = PTHREAD_PROCESS_PRIVATE;
return 0;
}
int pthread_condattr_setpshared(pthread_condattr_t*attr, int pshared)
{
if ((pshared != PTHREAD_PROCESS_PRIVATE) && (pshared != PTHREAD_PROCESS_SHARED))
return EINVAL;
if (pshared != PTHREAD_PROCESS_PRIVATE)
return ENOSYS;
return 0;
}
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
{
/* parameter check */
if (cond == RT_NULL) return EINVAL;
if ((attr != RT_NULL) && (*attr != PTHREAD_PROCESS_PRIVATE)) return EINVAL;
return 0;
}
int pthread_cond_destroy(pthread_cond_t *cond)
{
return 0;
}
int pthread_cond_broadcast(pthread_cond_t *cond)
{
return 0;
}
int pthread_cond_signal(pthread_cond_t *cond)
{
return 0;
}
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
return 0;
}
int pthread_cond_timedwait(pthread_cond_t *cond,
pthread_mutex_t * mutex,
const struct timespec *abstime)
{
return 0;
}