From 38210e851005e14696e3e3fd59c5c8efee20b12f Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 26 Dec 2024 22:52:51 -0500 Subject: [PATCH] kernel/team: Minor code cleanup in LockTeamAndParent and LockTeamAndProcessGroup. Make them look a bit more similar to each other. No functional change intended. --- src/system/kernel/team.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/system/kernel/team.cpp b/src/system/kernel/team.cpp index 8f1b1df69b..b7d4e25ae5 100644 --- a/src/system/kernel/team.cpp +++ b/src/system/kernel/team.cpp @@ -649,10 +649,10 @@ Team::LockTeamAndParent(bool dontLockParentIfKernel) while (true) { // If the team doesn't have a parent, we're done. Otherwise try to lock - // the parent.This will succeed in most cases, simplifying things. + // the parent. This will succeed in most cases, simplifying things. Team* parent = this->parent; if (parent == NULL || (dontLockParentIfKernel && parent == sKernelTeam) - || parent->TryLock()) { + || parent->TryLock()) { return; } @@ -734,10 +734,7 @@ Team::LockTeamAndProcessGroup() // Try to lock the group. This will succeed in most cases, simplifying // things. ProcessGroup* group = this->group; - if (group == NULL) - return; - - if (group->TryLock()) + if (group == NULL || group->TryLock()) return; // get a temporary reference to the group, unlock this team, lock the