mirror of
https://github.com/apache/nuttx.git
synced 2026-05-12 17:58:10 +08:00
0d12f82074
The dump_lockholder() function in assert.c was directly accessing themutex->holder member variable to print the mutex holder's thread ID inthe backtrace log. This is incorrect because the holder field is aprivate implementation detail of the mutex structure, and the properAPI nxmutex_get_holder() should be used to retrieve the holder ID. Using the public API ensures consistency with mutex state management,avoids potential issues with future changes to the mutex structure'sinternal layout, and adheres to the kernel's encapsulation principles. This fix corrects the log output to show the accurate mutex holder IDwhen assertion failures related to mutex locks occur, improving thedebuggability of lock-related issues. Signed-off-by: chao an <anchao.archer@bytedance.com>