kernel: Allocate user_mutex_contexts when adding the second thread to a team.

This allows us to gracefully fail if memory allocation fails,
rather than panic()ing. If a single-threaded application tries
to wait on a non-shared user_mutex in single-threaded mode, it
will now be dropped into the debugger.
This commit is contained in:
Augustin Cavalier
2026-03-04 21:42:03 -05:00
parent e6569ec320
commit 7ef695df5c
3 changed files with 23 additions and 19 deletions
+2
View File
@@ -7,6 +7,7 @@
#include <SupportDefs.h>
#include <thread_types.h>
#ifdef __cplusplus
@@ -17,6 +18,7 @@ struct user_mutex_context;
void user_mutex_init();
void delete_user_mutex_context(struct user_mutex_context* context);
status_t allocate_team_user_mutex_context(Team* team);
status_t _user_mutex_lock(int32* mutex, const char* name, uint32 flags,
bigtime_t timeout);