IRNAS / irnas-usersettings-lib

User settings library for Zephyr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Iteration of user settings is not thread safe

TjazVracko opened this issue · comments

See how user_settings_list_iter_start is implemented. It used global variables to keep track of the iteration.
This means 2 threads can not iterate at the same time.

This must be changes to use a "iter context", which is passed into the iterator functions.
What is now global must be part of that context.
The fix is quite simple.

The context must also be propagated up to the user_settings API - user_settings_iter_start, user_settings_iter_next, ...