kernel/team: Slight cleanup to the synchronization logic in load_image_internal.

Adjust the comment and use ASSERT() rather than a panic().
This commit is contained in:
Augustin Cavalier 2025-01-16 19:49:47 -05:00
parent 1124f672a0
commit 3f35917df2

View File

@ -1870,11 +1870,10 @@ load_image_internal(char**& _flatArgs, size_t flatArgsSize, int32 argCount,
// responsible for unsetting `loading_info` in the team structure. // responsible for unsetting `loading_info` in the team structure.
loadingWaitEntry.Wait(); loadingWaitEntry.Wait();
// We must synchronize with the thread that woke us up, to ensure // We must synchronize by temporarily reacquiring the Team lock, to
// there are no remaining consumers of the team_loading_info. // ensure there are no remaining consumers of the team_loading_info.
team->Lock(); team->Lock();
if (team->loading_info != NULL) ASSERT(team->loading_info == NULL);
panic("team loading wait complete, but loading_info != NULL");
team->Unlock(); team->Unlock();
teamLoadingReference.Unset(); teamLoadingReference.Unset();