提交 414c9d5c 编写于 作者: L LiteOS2021

fix(posix): posix兼容回退

posix兼容回退
Signed-off-by: NLiteOS2021 <dinglu@huawei.com>
上级 062e8b47
......@@ -550,7 +550,7 @@ typedef struct {
#endif
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { unsigned int magic; unsigned int handle; pthread_mutexattr_t stAttr;} pthread_mutex_t;
typedef struct { unsigned int magic; unsigned int handle; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
......
......@@ -57,10 +57,9 @@ extern "C" {
#define _MUX_MAGIC 0xEBCFDEA0
#define _MUX_INVALID_HANDLE 0xEEEEEEEF
#define PTHREAD_MUTEXATTR_INITIALIZER { PTHREAD_MUTEX_DEFAULT }
#define PTHREAD_MUTEX_INITIALIZER { _MUX_MAGIC, _MUX_INVALID_HANDLE, PTHREAD_MUTEXATTR_INITIALIZER }
#define PTHREAD_MUTEX_INITIALIZER { _MUX_MAGIC, _MUX_INVALID_HANDLE }
#ifdef _GNU_SOURCE
#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP { _MUX_MAGIC, _MUX_INVALID_HANDLE, PTHREAD_MUTEXATTR_INITIALIZER }
#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP { _MUX_MAGIC, _MUX_INVALID_HANDLE }
#endif
#define PTHREAD_RWLOCK_INITIALIZER {{{0}}}
#define PTHREAD_COND_INITIALIZER {{{0}}}
......@@ -91,6 +90,9 @@ __attribute__((const))
pthread_t pthread_self(void);
int pthread_equal(pthread_t, pthread_t);
#ifndef __cplusplus
#define pthread_equal(x,y) ((x)==(y))
#endif
int pthread_setcancelstate(int, int *);
int pthread_setcanceltype(int, int *);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册