mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-22 08:24:18 +08:00
add thread local storage feature.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1049 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -18,22 +18,7 @@
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef rt_thread_t pthread_t;
|
||||
typedef long pthread_condattr_t;
|
||||
typedef long pthread_rwlockattr_t;
|
||||
typedef long pthread_mutexattr_t;
|
||||
typedef long pthread_barrierattr_t;
|
||||
|
||||
typedef int pthread_key_t;
|
||||
typedef int pthread_once_t;
|
||||
|
||||
enum {
|
||||
PTHREAD_CANCEL_ASYNCHRONOUS = 0,
|
||||
PTHREAD_CANCEL_ENABLE,
|
||||
PTHREAD_CANCEL_DEFERRED,
|
||||
PTHREAD_CANCEL_DISABLE,
|
||||
PTHREAD_CANCELED
|
||||
};
|
||||
#define PTHREAD_KEY_MAX 8
|
||||
|
||||
#define PTHREAD_COND_INITIALIZER {-1, 0}
|
||||
#define PTHREAD_RWLOCK_INITIALIZER {-1, 0}
|
||||
@@ -45,6 +30,30 @@ enum {
|
||||
#define PTHREAD_EXPLICIT_SCHED 0
|
||||
#define PTHREAD_INHERIT_SCHED 1
|
||||
|
||||
typedef rt_thread_t pthread_t;
|
||||
typedef long pthread_condattr_t;
|
||||
typedef long pthread_rwlockattr_t;
|
||||
typedef long pthread_mutexattr_t;
|
||||
typedef long pthread_barrierattr_t;
|
||||
|
||||
typedef int pthread_key_t;
|
||||
typedef int pthread_once_t;
|
||||
|
||||
/*
|
||||
* Scheduling policies required by IEEE Std 1003.1-2001
|
||||
*/
|
||||
#define SCHED_OTHER 0 /* Behavior can be FIFO or RR, or not */
|
||||
#define SCHED_FIFO 1
|
||||
#define SCHED_RR 2
|
||||
|
||||
enum {
|
||||
PTHREAD_CANCEL_ASYNCHRONOUS = 0,
|
||||
PTHREAD_CANCEL_ENABLE,
|
||||
PTHREAD_CANCEL_DEFERRED,
|
||||
PTHREAD_CANCEL_DISABLE,
|
||||
PTHREAD_CANCELED
|
||||
};
|
||||
|
||||
enum {
|
||||
PTHREAD_MUTEX_NORMAL = 0,
|
||||
PTHREAD_MUTEX_RECURSIVE = 1,
|
||||
@@ -66,7 +75,6 @@ enum {
|
||||
#define PTHREAD_PROCESS_PRIVATE 0
|
||||
#define PTHREAD_PROCESS_SHARED 1
|
||||
|
||||
|
||||
#define PTHREAD_SCOPE_PROCESS 0
|
||||
#define PTHREAD_SCOPE_SYSTEM 1
|
||||
|
||||
@@ -129,13 +137,6 @@ struct pthread_barrier
|
||||
};
|
||||
typedef struct pthread_barrier pthread_barrier_t;
|
||||
|
||||
/*
|
||||
* Scheduling policies required by IEEE Std 1003.1-2001
|
||||
*/
|
||||
#define SCHED_OTHER 0 /* Behavior can be FIFO or RR, or not */
|
||||
#define SCHED_FIFO 1
|
||||
#define SCHED_RR 2
|
||||
|
||||
/* pthread thread interface */
|
||||
int pthread_attr_destroy(pthread_attr_t *attr);
|
||||
int pthread_attr_init(pthread_attr_t *attr);
|
||||
|
Reference in New Issue
Block a user