This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 0dd221cc763a6b41198868f245593126741d6ba5
Author: Nightt <[email protected]>
AuthorDate: Mon May 25 10:47:43 2026 +0800

    system/settings: Drop unused recursive mutex type
    
    The settings save path no longer re-enters g_settings.mtx, so the mutex 
does not need to be initialized as PTHREAD_MUTEX_RECURSIVE.
    
    This keeps the #3105 fix independent of CONFIG_PTHREAD_MUTEX_TYPES and 
destroys the temporary mutex attribute object after initialization.
    
    Signed-off-by: Nightt <[email protected]>
---
 system/settings/settings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system/settings/settings.c b/system/settings/settings.c
index c478e96f8..1625c3f5a 100644
--- a/system/settings/settings.c
+++ b/system/settings/settings.c
@@ -772,9 +772,9 @@ void settings_init(void)
   pthread_mutexattr_t attr;
 
   pthread_mutexattr_init(&attr);
-  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
   pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
   pthread_mutex_init(&g_settings.mtx, &attr);
+  pthread_mutexattr_destroy(&attr);
 
   memset(map, 0, sizeof(map));
   memset(g_settings.store, 0, sizeof(g_settings.store));

Reply via email to