diff options
| author | bernard <[email protected]> | 2017-10-15 22:41:59 +0800 |
|---|---|---|
| committer | bernard <[email protected]> | 2017-10-15 22:41:59 +0800 |
| commit | 5c7b16d00bdb536a694e6e31a2e0a1c33cb9dcb9 (patch) | |
| tree | 5da5e3404e1241b65e90089c4c370b40130df832 /components/libc/pthreads/pthread.c | |
| parent | b27c7e482648535760e012cd6f1afef1d800e2d2 (diff) | |
[libc] Update libc.
1. Add POSIX termios implementation;
2. Add POSIX signals implementation;
3. Add stdio for each libc.
Diffstat (limited to 'components/libc/pthreads/pthread.c')
| -rw-r--r-- | components/libc/pthreads/pthread.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/components/libc/pthreads/pthread.c b/components/libc/pthreads/pthread.c index eb7d582e59..f88dda9ab0 100644 --- a/components/libc/pthreads/pthread.c +++ b/components/libc/pthreads/pthread.c @@ -194,7 +194,7 @@ int pthread_detach(pthread_t thread) ptd = _pthread_get_data(thread); - if (thread->stat == RT_THREAD_CLOSE) + if ((thread->stat & RT_THREAD_STAT_MASK)== RT_THREAD_CLOSE) { /* delete joinable semaphore */ if (ptd->joinable_sem != RT_NULL) @@ -354,10 +354,21 @@ RTM_EXPORT(pthread_atfork); int pthread_kill(pthread_t thread, int sig) { - return EOPNOTSUPP; +#ifdef RT_USING_SIGNALS + return rt_thread_kill(thread, sig); +#else + return ENOSYS; +#endif } RTM_EXPORT(pthread_kill); +#ifdef RT_USING_SIGNALS +int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) +{ + return sigprocmask(how, set, oset); +} +#endif + void pthread_cleanup_pop(int execute) { _pthread_data_t *ptd; |
