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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user