diff options
Diffstat (limited to 'components/pthreads/semaphore.c')
| -rw-r--r-- | components/pthreads/semaphore.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/components/pthreads/semaphore.c b/components/pthreads/semaphore.c index eb275ed9b3..23a73ed093 100644 --- a/components/pthreads/semaphore.c +++ b/components/pthreads/semaphore.c @@ -1,6 +1,6 @@ #include <rtthread.h> #include "semaphore.h" -#include "pthread_internal.h"
+#include "pthread_internal.h" static sem_t* posix_sem_list = RT_NULL; static struct rt_semaphore posix_sem_lock; @@ -58,8 +58,8 @@ static sem_t *posix_sem_find(const char* name) { return iter; } - }
-
+ } + return RT_NULL; } @@ -85,6 +85,7 @@ int sem_close(sem_t *sem) return 0; } +RTM_EXPORT(sem_close); int sem_destroy(sem_t *sem) { @@ -112,6 +113,7 @@ int sem_destroy(sem_t *sem) return 0; } +RTM_EXPORT(sem_destroy); int sem_unlink(const char *name) { @@ -137,6 +139,7 @@ int sem_unlink(const char *name) rt_set_errno(ENOENT); return -1; } +RTM_EXPORT(sem_unlink); int sem_getvalue(sem_t *sem, int *sval) { @@ -148,6 +151,7 @@ int sem_getvalue(sem_t *sem, int *sval) *sval = sem->sem->value; return 0; } +RTM_EXPORT(sem_getvalue); int sem_init(sem_t *sem, int pshared, unsigned int value) { @@ -179,6 +183,7 @@ int sem_init(sem_t *sem, int pshared, unsigned int value) return 0; } +RTM_EXPORT(sem_init); sem_t *sem_open(const char *name, int oflag, ...) { @@ -259,6 +264,7 @@ __return: } return RT_NULL; } +RTM_EXPORT(sem_open); int sem_post(sem_t *sem) { @@ -276,6 +282,7 @@ int sem_post(sem_t *sem) rt_set_errno(EINVAL); return -1; } +RTM_EXPORT(sem_post); int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout) { @@ -298,6 +305,7 @@ int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout) rt_set_errno(EINTR); return -1; } +RTM_EXPORT(sem_timedwait); int sem_trywait(sem_t *sem) { @@ -320,6 +328,7 @@ int sem_trywait(sem_t *sem) rt_set_errno(EINTR); return -1; } +RTM_EXPORT(sem_trywait); int sem_wait(sem_t *sem) { @@ -337,4 +346,5 @@ int sem_wait(sem_t *sem) rt_set_errno(EINTR); return -1; } +RTM_EXPORT(sem_wait); |
