4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-29 09:20:26 +08:00
bernard.xiong 25f50375ef add initial pthread implementation.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1044 bbd45198-f89e-11dd-88c7-29a3b14d5316
2010-11-12 10:26:36 +00:00

26 lines
935 B
C

#ifndef __PTHREAD_MUTEX_H__
#define __PTHREAD_MUTEX_H__
typedef long pthread_mutexattr_t;
struct pthread_mutex
{
pthread_mutexattr_t attr;
struct rt_mutex lock;
};
typedef struct pthread_mutex pthread_mutex_t;
int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr);
int pthread_mutex_destroy(pthread_mutex_t *mutex);
int pthread_mutex_lock(pthread_mutex_t *mutex);
int pthread_mutex_unlock(pthread_mutex_t *mutex);
int pthread_mutex_trylock(pthread_mutex_t *mutex);
int pthread_mutexattr_init(pthread_mutexattr_t *attr);
int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared);
int pthread_mutexattr_getpshared(pthread_mutexattr_t *attr, int *pshared);
#endif