summaryrefslogtreecommitdiff
path: root/components/libc/pthreads
diff options
context:
space:
mode:
authorcliff-cmc <[email protected]>2021-02-26 11:09:27 +0800
committerCliff Chen <[email protected]>2021-02-26 11:45:19 +0800
commiteea0c3d74a40f73235da45c6f77e8b411ac94cf2 (patch)
treea6906f1aed7118ab53dbe18f2ee4727a754583af /components/libc/pthreads
parent1a9ecf27f31277750d92c921b62503f75275e122 (diff)
parentfae0fa8eea4c0e797940bf1eddc8ee6c1711734a (diff)
Add memtrace command for memheap.c
Diffstat (limited to 'components/libc/pthreads')
-rw-r--r--components/libc/pthreads/SConscript2
-rw-r--r--components/libc/pthreads/pthread.c2
-rw-r--r--components/libc/pthreads/pthread_internal.h3
-rw-r--r--components/libc/pthreads/semaphore.c2
4 files changed, 4 insertions, 5 deletions
diff --git a/components/libc/pthreads/SConscript b/components/libc/pthreads/SConscript
index e154ee0aa9..767b406d4c 100644
--- a/components/libc/pthreads/SConscript
+++ b/components/libc/pthreads/SConscript
@@ -16,7 +16,7 @@ try:
except :
pass
-group = DefineGroup('pthreads', src,
+group = DefineGroup('libc', src,
depend = ['RT_USING_PTHREADS', 'RT_USING_LIBC'], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
Return('group')
diff --git a/components/libc/pthreads/pthread.c b/components/libc/pthreads/pthread.c
index 19a511b45b..7430510bf2 100644
--- a/components/libc/pthreads/pthread.c
+++ b/components/libc/pthreads/pthread.c
@@ -13,6 +13,7 @@
#include <rthw.h>
#include <pthread.h>
#include <sched.h>
+#include <sys/time.h>
#include "pthread_internal.h"
RT_DEFINE_SPINLOCK(pth_lock);
@@ -687,4 +688,3 @@ int pthread_cancel(pthread_t thread)
return 0;
}
RTM_EXPORT(pthread_cancel);
-
diff --git a/components/libc/pthreads/pthread_internal.h b/components/libc/pthreads/pthread_internal.h
index a6706ca091..240741e21a 100644
--- a/components/libc/pthreads/pthread_internal.h
+++ b/components/libc/pthreads/pthread_internal.h
@@ -13,6 +13,7 @@
#include <rtthread.h>
#include <pthread.h>
+#include <sys/time.h>
struct _pthread_cleanup
{
@@ -62,8 +63,6 @@ typedef struct _pthread_data _pthread_data_t;
_pthread_data_t *_pthread_get_data(pthread_t thread);
-int clock_time_to_tick(const struct timespec *time);
-
void posix_mq_system_init(void);
void posix_sem_system_init(void);
void pthread_key_system_init(void);
diff --git a/components/libc/pthreads/semaphore.c b/components/libc/pthreads/semaphore.c
index 2bef10022e..2ed93e99b6 100644
--- a/components/libc/pthreads/semaphore.c
+++ b/components/libc/pthreads/semaphore.c
@@ -64,7 +64,7 @@ static sem_t *posix_sem_find(const char* name)
for (iter = posix_sem_list; iter != RT_NULL; iter = iter->next)
{
- object = (rt_object_t)&(iter->sem);
+ object = (rt_object_t)iter->sem;
if (strncmp(object->name, name, RT_NAME_MAX) == 0)
{