summaryrefslogtreecommitdiff
path: root/components/libc/pthreads/pthread.h
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-05-12 17:01:26 +0800
committerGitHub <[email protected]>2019-05-12 17:01:26 +0800
commitb7cc4e9c8ad48f49e20f310298a1adbe1567d710 (patch)
treeb97f29bd4a9e3956e894e85d1dbda7993dd11683 /components/libc/pthreads/pthread.h
parent377875858f4f7c6e9e99f87621b6065680270d5d (diff)
parent3638e5129ebca52190976ebd1f600af078996449 (diff)
Merge pull request #2678 from BernardXiong/pthreads
[pthreads] The fields definition are more like those of newlib/glibc.
Diffstat (limited to 'components/libc/pthreads/pthread.h')
-rw-r--r--components/libc/pthreads/pthread.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/components/libc/pthreads/pthread.h b/components/libc/pthreads/pthread.h
index f9a0a92b68..c86ee90b0e 100644
--- a/components/libc/pthreads/pthread.h
+++ b/components/libc/pthreads/pthread.h
@@ -76,15 +76,21 @@ enum
#define PTHREAD_SCOPE_PROCESS 0
#define PTHREAD_SCOPE_SYSTEM 1
+struct sched_param
+{
+ int sched_priority;
+};
+
struct pthread_attr
{
- void* stack_base;
- rt_uint32_t stack_size; /* stack size of thread */
+ void* stackaddr; /* stack address of thread */
+ int stacksize; /* stack size of thread */
+
+ int inheritsched; /* Inherit parent prio/policy */
+ int schedpolicy; /* scheduler policy */
+ struct sched_param schedparam; /* sched parameter */
- rt_uint8_t priority; /* priority of thread */
- rt_uint8_t detachstate; /* detach state */
- rt_uint8_t policy; /* scheduler policy */
- rt_uint8_t inheritsched; /* Inherit parent prio/policy */
+ int detachstate; /* detach state */
};
typedef struct pthread_attr pthread_attr_t;
@@ -131,11 +137,6 @@ struct pthread_barrier
};
typedef struct pthread_barrier pthread_barrier_t;
-struct sched_param
-{
- int sched_priority;
-};
-
/* pthread thread interface */
int pthread_attr_destroy(pthread_attr_t *attr);
int pthread_attr_init(pthread_attr_t *attr);