Skip to content
Commit ca49d6a8 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Anas Nashif
Browse files

PTHREAD_MUTEX_DEFINE(): don't store into the _k_mutex section



The _k_mutex linker section is used to gather instances of
struct k_mutex into a list so that init_mutex_module() could iterate
that list to perform runtime initialization tasks. In this case, we're
not defining a struct k_mutex but rather a struct pthread_mutex which is
a completely different structure. Not only those struct pthread_mutex
would be corrupted with unexpected data, but since they're not the
same size as struct k_mutex, the actual struct k_mutex instances that
follow in the list would be misaligned and get corrupted too.

There is nothing that requires runtime initialization in the static
definition of a struct pthread_mutex so let's remove the section
attribute.

Signed-off-by: default avatarNicolas Pitre <npitre@baylibre.com>
parent 8ab22556
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment