posix: deprecate PTHREAD_IPC _MUTEX _COND and _KEY

Zephyr's POSIX API is moving toward using the standard
nomenclature from IEEE 1003.1-2017 for as much as possible. In
particular, we want to have consistent naming between Zephyr's
POSIX API Kconfig options and the naming for POSIX Options and
Option Groups.

The Kconfig option CONFIG_PTHREAD_IPC has been (ab)used for a
very long time for a variety of different purposes. However,
the standard Option / feature test macro for POSIX Threads is,
intuitively _POSIX_THREADS. There is a corresponding sysconf()
key named _SC_POSIX_THREADS.

Annoyingly, the POSIX Option Group that corresponds to the
Option is POSIX_THREADS_BASE, which is a minor inconsistency
in the standard.

The _POSIX_THREADS Option already includes mutexes, condition
variables, and thread-specific storage (keys). So with this
change, we also deprecate the redundant Kconfig variables that
do not have a corresponding match in the standard.

- CONFIG_PTHREAD_IPC
- CONFIG_PTHREAD
- CONFIG_PTHREAD_COND
- CONFIG_PTHREAD_MUTEX
- CONFIG_PTHREAD_KEY

Additionally, create Kconfig variables for those configurables
which we are lacking:

- CONFIG_POSIX_THREADS_EXT
- CONFIG_POSIX_THREAD_ATTR_STACKSIZE
- CONFIG_POSIX_THREAD_ATTR_STACKADDR
- CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING
- CONFIG_POSIX_THREAD_PRIO_INHERIT
- CONFIG_POSIX_THREAD_PRIO_PROTECT
- CONFIG_POSIX_THREAD_SAFE_FUNCTIONS

Some Kconfig variables were renamed to more properly match the spec:

- CONFIG_MAX_PTHREAD_COUNT -> CONFIG_POSIX_THREAD_THREADS_MAX
- CONFIG_MAX_PTHREAD_KEY_COUNT -> CONFIG_POSIX_THREAD_KEYS_MAX

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
Chris Friedt 2024-05-22 23:48:17 -04:00 committed by David Leach
commit fcebe60090
36 changed files with 349 additions and 211 deletions

View file

@ -33,6 +33,24 @@ config GETOPT
Please use CONFIG_POSIX_C_LIB_EXT instead.
config MAX_PTHREAD_COUNT
int "Maximum number of pthread_t [DEPRECATED]"
default POSIX_THREAD_THREADS_MAX if POSIX_THREADS
default 0
help
This option is deprecated.
Please use CONFIG_POSIX_THREAD_THREADS_MAX instead.
config MAX_PTHREAD_KEY_COUNT
int "Maximum number of pthread_key_t [DEPRECATED]"
default POSIX_THREAD_KEYS_MAX if POSIX_THREADS
default 0
help
This option is deprecated.
Please use CONFIG_POSIX_THREAD_KEYS_MAX instead.
config MAX_TIMER_COUNT
int "Maximum number of timer_t [DEPRECATED]"
default POSIX_TIMER_MAX if POSIX_TIMERS
@ -165,6 +183,15 @@ config POSIX_UNAME
Please use CONFIG_POSIX_SINGLE_PROCESS instead.
config PTHREAD
bool "pthread_t support [DEPRECATED]"
select DEPRECATED
select POSIX_THREADS
help
This option is deprecated.
Please use CONFIG_POSIX_THREADS instead.
config PTHREAD_BARRIER
bool "pthread_barrier_t support [DEPRECATED]"
select DEPRECATED
@ -174,6 +201,43 @@ config PTHREAD_BARRIER
Please use CONFIG_POSIX_BARRIERS instead.
config PTHREAD_COND
bool "pthread_cond_t support [DEPRECATED]"
select DEPRECATED
select POSIX_THREADS
help
This option is deprecated.
Please use CONFIG_POSIX_THREADS instead.
config PTHREAD_IPC
bool "POSIX pthread IPC API [DEPRECATED]"
select DEPRECATED
select POSIX_THREADS
help
This option is deprecated.
Please use CONFIG_POSIX_THREADS instead.
config PTHREAD_KEY
bool "pthread_key_t support [DEPRECATED]"
select DEPRECATED
select POSIX_THREADS
help
This option is deprecated.
Please use CONFIG_POSIX_THREADS instead.
config PTHREAD_MUTEX
bool "pthread_mutex_t support [DEPRECATED]"
select DEPRECATED
select POSIX_THREADS
help
This option is deprecated.
Please use CONFIG_POSIX_THREADS instead.
config PTHREAD_RWLOCK
bool "pthread_spinlock_t support [DEPRECATED]"
select DEPRECATED