diff options
Diffstat (limited to 'components/libc/pthreads')
| -rw-r--r-- | components/libc/pthreads/mqueue.c | 2 | ||||
| -rw-r--r-- | components/libc/pthreads/mqueue.h | 2 | ||||
| -rw-r--r-- | components/libc/pthreads/posix_types.h | 4 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread.c | 4 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread.h | 4 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread_attr.c | 4 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread_barrier.c | 2 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread_cond.c | 10 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread_internal.h | 2 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread_mutex.c | 4 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread_rwlock.c | 10 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread_spin.c | 2 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread_tls.c | 2 | ||||
| -rw-r--r-- | components/libc/pthreads/sched.c | 2 | ||||
| -rw-r--r-- | components/libc/pthreads/sched.h | 2 | ||||
| -rw-r--r-- | components/libc/pthreads/semaphore.c | 2 | ||||
| -rw-r--r-- | components/libc/pthreads/semaphore.h | 2 |
17 files changed, 30 insertions, 30 deletions
diff --git a/components/libc/pthreads/mqueue.c b/components/libc/pthreads/mqueue.c index 003b49b9a0..1af0ab2919 100644 --- a/components/libc/pthreads/mqueue.c +++ b/components/libc/pthreads/mqueue.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/mqueue.h b/components/libc/pthreads/mqueue.h index 5cadde3ae8..5152bfad29 100644 --- a/components/libc/pthreads/mqueue.h +++ b/components/libc/pthreads/mqueue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/posix_types.h b/components/libc/pthreads/posix_types.h index ca20464bb5..f2d806cc9a 100644 --- a/components/libc/pthreads/posix_types.h +++ b/components/libc/pthreads/posix_types.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2013-12-23 Bernard Add the checking for ESHUTDOWN + * 2013-12-23 Bernard Add the checking for ESHUTDOWN */ #ifndef __POSIX_TYPES_H__ diff --git a/components/libc/pthreads/pthread.c b/components/libc/pthreads/pthread.c index 5d3bc0796a..eabc929728 100644 --- a/components/libc/pthreads/pthread.c +++ b/components/libc/pthreads/pthread.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -200,7 +200,7 @@ int pthread_create(pthread_t *pid, /* allocate posix thread data */ pth_id = _pthread_data_create(); - if (pth_id == PTHREAD_NUM_MAX) + if (pth_id == PTHREAD_NUM_MAX) { ret = ENOMEM; goto __exit; diff --git a/components/libc/pthreads/pthread.h b/components/libc/pthreads/pthread.h index 7bb72b726c..8639c1604b 100644 --- a/components/libc/pthreads/pthread.h +++ b/components/libc/pthreads/pthread.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -161,7 +161,7 @@ int pthread_attr_getguardsize(pthread_attr_t const *attr, size_t *guard_size); int pthread_attr_setscope(pthread_attr_t *attr, int scope); int pthread_attr_getscope(pthread_attr_t const *attr); int pthread_system_init(void); -int pthread_create (pthread_t *tid, const pthread_attr_t *attr, +int pthread_create (pthread_t *tid, const pthread_attr_t *attr, void *(*start) (void *), void *arg); int pthread_detach (pthread_t thread); diff --git a/components/libc/pthreads/pthread_attr.c b/components/libc/pthreads/pthread_attr.c index 2294599bf3..4aedf5a90d 100644 --- a/components/libc/pthreads/pthread_attr.c +++ b/components/libc/pthreads/pthread_attr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -16,7 +16,7 @@ #define DEFAULT_STACK_SIZE 2048 #define DEFAULT_PRIORITY (RT_THREAD_PRIORITY_MAX/2 + RT_THREAD_PRIORITY_MAX/4) -const pthread_attr_t pthread_default_attr = +const pthread_attr_t pthread_default_attr = { 0, /* stack base */ DEFAULT_STACK_SIZE, /* stack size */ diff --git a/components/libc/pthreads/pthread_barrier.c b/components/libc/pthreads/pthread_barrier.c index d76fe7f13f..1a5b7fa3f9 100644 --- a/components/libc/pthreads/pthread_barrier.c +++ b/components/libc/pthreads/pthread_barrier.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/pthread_cond.c b/components/libc/pthreads/pthread_cond.c index 38dc697469..59c271bf6e 100644 --- a/components/libc/pthreads/pthread_cond.c +++ b/components/libc/pthreads/pthread_cond.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -84,10 +84,10 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) rt_snprintf(cond_name, sizeof(cond_name), "cond%02d", cond_num++); - if (attr == RT_NULL) /* use default value */ - cond->attr = PTHREAD_PROCESS_PRIVATE; - else - cond->attr = *attr; + if (attr == RT_NULL) /* use default value */ + cond->attr = PTHREAD_PROCESS_PRIVATE; + else + cond->attr = *attr; result = rt_sem_init(&cond->sem, cond_name, 0, RT_IPC_FLAG_FIFO); if (result != RT_EOK) diff --git a/components/libc/pthreads/pthread_internal.h b/components/libc/pthreads/pthread_internal.h index a6706ca091..24f24c8ce0 100644 --- a/components/libc/pthreads/pthread_internal.h +++ b/components/libc/pthreads/pthread_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/pthread_mutex.c b/components/libc/pthreads/pthread_mutex.c index 8f96531782..a681380b11 100644 --- a/components/libc/pthreads/pthread_mutex.c +++ b/components/libc/pthreads/pthread_mutex.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -211,7 +211,7 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex) result = rt_mutex_release(&(mutex->lock)); if (result == RT_EOK) return 0; - + return EINVAL; } RTM_EXPORT(pthread_mutex_unlock); diff --git a/components/libc/pthreads/pthread_rwlock.c b/components/libc/pthreads/pthread_rwlock.c index 64a0e221b4..1c2fe19f5f 100644 --- a/components/libc/pthreads/pthread_rwlock.c +++ b/components/libc/pthreads/pthread_rwlock.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -60,7 +60,7 @@ int pthread_rwlock_init(pthread_rwlock_t *rwlock, pthread_mutex_init(&(rwlock->rw_mutex), NULL); pthread_cond_init(&(rwlock->rw_condreaders), NULL); pthread_cond_init(&(rwlock->rw_condwriters), NULL); - + rwlock->rw_nwaitwriters = 0; rwlock->rw_nwaitreaders = 0; rwlock->rw_refcount = 0; @@ -117,7 +117,7 @@ int pthread_rwlock_destroy (pthread_rwlock_t *rwlock) pthread_mutex_unlock(&rwlock->rw_mutex); if (result == 0) pthread_mutex_destroy(&rwlock->rw_mutex); - + return result; } RTM_EXPORT(pthread_rwlock_destroy); @@ -234,7 +234,7 @@ int pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock, result = pthread_cond_timedwait(&rwlock->rw_condwriters, &rwlock->rw_mutex, abstime); /* rw_mutex should have been taken again when returned from waiting */ rwlock->rw_nwaitwriters--; - + if (result != 0) break; } @@ -324,7 +324,7 @@ int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) result = pthread_cond_wait(&rwlock->rw_condwriters, &rwlock->rw_mutex); /* rw_mutex should have been taken again when returned from waiting */ rwlock->rw_nwaitwriters--; - + if (result != 0) break; } diff --git a/components/libc/pthreads/pthread_spin.c b/components/libc/pthreads/pthread_spin.c index b31f4f6393..3f3dc1593c 100644 --- a/components/libc/pthreads/pthread_spin.c +++ b/components/libc/pthreads/pthread_spin.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/pthread_tls.c b/components/libc/pthreads/pthread_tls.c index 4b97d796d9..d48df7f2dd 100644 --- a/components/libc/pthreads/pthread_tls.c +++ b/components/libc/pthreads/pthread_tls.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/sched.c b/components/libc/pthreads/sched.c index a1bf50985e..5f2a53c01f 100644 --- a/components/libc/pthreads/sched.c +++ b/components/libc/pthreads/sched.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/sched.h b/components/libc/pthreads/sched.h index dbaf66edc2..07e2c0c6a8 100644 --- a/components/libc/pthreads/sched.h +++ b/components/libc/pthreads/sched.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/semaphore.c b/components/libc/pthreads/semaphore.c index 2ed93e99b6..398cdf1f49 100644 --- a/components/libc/pthreads/semaphore.c +++ b/components/libc/pthreads/semaphore.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/semaphore.h b/components/libc/pthreads/semaphore.h index d135ae9261..872226e385 100644 --- a/components/libc/pthreads/semaphore.h +++ b/components/libc/pthreads/semaphore.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * |
