incubator-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.h sched: Check the mutex consistent in main thread too 2020-06-15 07:16:21 -06: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 sched/: Make more naming consistent 2020-05-17 14:01:00 -03:00
pthread_condbroadcast.c sched/: Make more naming consistent 2020-05-17 14:01:00 -03:00
pthread_condclockwait.c sched/wdog: Remove MAX_WDOGPARMS and related stuff 2020-08-14 08:19:50 -06:00
pthread_condsignal.c Run nxstyle all .c and .h files modified by PR. 2020-05-17 14:01:00 -03:00
pthread_condwait.c sched/pthread_cond[timed]wait.c: return special mutex state. 2020-04-06 00:13:05 +01:00
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 Fix wait loop and void cast (#24) 2020-01-02 10:54:43 -06:00
pthread_exit.c sched: Check the mutex consistent in main thread too 2020-06-15 07:16:21 -06:00
pthread_findjoininfo.c Fix typos in comments and documentation. 2020-03-16 20:01:11 -06:00
pthread_getaffinity.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
pthread_getschedparam.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
pthread_initialize.c Replace #include <semaphore.h> to #include <nuttx/semaphore.h> 2020-02-01 08:27:30 -06:00
pthread_join.c sched: pthread: Fix pthread_join() for SMP 2020-11-10 19:41:46 -08:00
pthread_kill.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
pthread_mutex.c sched: Check the mutex consistent in main thread too 2020-06-15 07:16:21 -06:00
pthread_mutexconsistent.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
pthread_mutexdestroy.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
pthread_mutexinconsistent.c sched: Check the mutex consistent in main thread too 2020-06-15 07:16:21 -06:00
pthread_mutexinit.c Run nxstyle all .c and .h files modified by PR. 2020-05-17 14:01:00 -03:00
pthread_mutextimedlock.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
pthread_mutextrylock.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
pthread_mutexunlock.c tools/nxstyle.c: Fix error in conditional logic that was preventing detection bad brace alignment. Add logic to handle alignment of braces in data initializators which following slightly different indentation rules. 2019-06-30 10:35:10 -06:00
pthread_release.c global change: repace sched_xfree() to kxmm_free() 2020-04-09 10:29:28 -06:00
pthread_setaffinity.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
pthread_setschedparam.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
pthread_setschedprio.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
pthread_sigmask.c Fix typos 2020-10-17 09:04:37 +01:00