nuttx/sched/pthread
Masayuki Ishikawa f0bf2143f6 sched: pthread: Fix pthread_join() for SMP
Summary:
- I noticed 'pthread_rwlock test' in ostest sometimes stops
- This issue happened with spresense:wifi_smp (NCPUS=4) and sim:smp
- Finally, I found an issue in pthread_join()
- In pthread_join(), sched_lock() is used to avoid pre-emption
- However, this is not enough for SMP
- Because another CPU would continue the pthread and exit sequences
- So we need to protect it with a critical section

Impact:
- Affect SMP only

Testing:
- Tested with ostest with the following configurations
- spresnese:smp
- spresense:wifi_smp (NCPUS=2, NCPUS=4)
- sabre-6quad:smp (QEMU)
- esp32-core:smp (QEMU)
- maix-bit:smp (QEMU)
- sim:smp
- lc823450-xgevk:rndis

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-11-10 19:41:46 -08:00
..
Make.defs Implement proposed POSIX _clockwait variants of existing _timedwait functions 2020-07-27 20:39:59 -03:00
pthread_cancel.c sched: Consolidate the cancellation notification logic 2020-06-15 21:21:14 +01:00
pthread_cleanup.c sched/pthread/pthread_cleanup.c: Exclude kernel threads. 2020-06-17 13:18:30 -03:00
pthread_completejoin.c
pthread_condbroadcast.c
pthread_condclockwait.c sched/wdog: Remove MAX_WDOGPARMS and related stuff 2020-08-14 08:19:50 -06:00
pthread_condsignal.c
pthread_condwait.c
pthread_create.c Revert "sched: Call up_[use|create]_stack after nxtask_setup_scheduler" 2020-10-22 18:31:31 +09:00
pthread_detach.c
pthread_exit.c sched: Check the mutex consistent in main thread too 2020-06-15 07:16:21 -06:00
pthread_findjoininfo.c
pthread_getaffinity.c
pthread_getschedparam.c
pthread_initialize.c
pthread_join.c sched: pthread: Fix pthread_join() for SMP 2020-11-10 19:41:46 -08:00
pthread_kill.c
pthread_mutex.c sched: Check the mutex consistent in main thread too 2020-06-15 07:16:21 -06:00
pthread_mutexconsistent.c
pthread_mutexdestroy.c
pthread_mutexinconsistent.c sched: Check the mutex consistent in main thread too 2020-06-15 07:16:21 -06:00
pthread_mutexinit.c
pthread_mutextimedlock.c
pthread_mutextrylock.c
pthread_mutexunlock.c
pthread_release.c
pthread_setaffinity.c
pthread_setschedparam.c
pthread_setschedprio.c
pthread_sigmask.c Fix typos 2020-10-17 09:04:37 +01:00
pthread.h sched: Check the mutex consistent in main thread too 2020-06-15 07:16:21 -06:00