libprocessgroup: Don't sleep after last cgroup removal attempt
Currently we sleep for 5ms before decrementing retries for the last time. This is a waste of time, so bail out of the loop if the last rmdir attempt fails. Change-Id: Ia20840d27592b4eb3d9762647b19c111ff94209f
This commit is contained in:
parent
5a2d8514de
commit
b02f94490d
1 changed files with 1 additions and 1 deletions
|
|
@ -219,7 +219,7 @@ static int RemoveProcessGroup(const char* cgroup, uid_t uid, int pid, unsigned i
|
|||
|
||||
while (retries--) {
|
||||
ret = rmdir(uid_pid_path.c_str());
|
||||
if (!ret || errno != EBUSY) break;
|
||||
if (!ret || errno != EBUSY || !retries) break;
|
||||
std::this_thread::sleep_for(5ms);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue