From 3f35917df280577c8f8c29a9472e11dca0745cd0 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 16 Jan 2025 19:49:47 -0500 Subject: [PATCH] kernel/team: Slight cleanup to the synchronization logic in load_image_internal. Adjust the comment and use ASSERT() rather than a panic(). --- src/system/kernel/team.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/team.cpp b/src/system/kernel/team.cpp index 26cb6cb9d2..1f917d8593 100644 --- a/src/system/kernel/team.cpp +++ b/src/system/kernel/team.cpp @@ -1870,11 +1870,10 @@ load_image_internal(char**& _flatArgs, size_t flatArgsSize, int32 argCount, // responsible for unsetting `loading_info` in the team structure. loadingWaitEntry.Wait(); - // We must synchronize with the thread that woke us up, to ensure - // there are no remaining consumers of the team_loading_info. + // We must synchronize by temporarily reacquiring the Team lock, to + // ensure there are no remaining consumers of the team_loading_info. team->Lock(); - if (team->loading_info != NULL) - panic("team loading wait complete, but loading_info != NULL"); + ASSERT(team->loading_info == NULL); team->Unlock(); teamLoadingReference.Unset();