The main reason I commit this: the last change also made set_sem_owner() to check
for a valid team id. Added a comment about a race condition in set_sem_owner(). Some minor style changes. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1309 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -739,6 +739,9 @@ set_sem_owner(sem_id id, team_id team)
|
||||
return B_BAD_SEM_ID;
|
||||
}
|
||||
|
||||
// Todo: this is a small race condition: the team ID could already
|
||||
// be invalid at this point - we would lose one semaphore slot in
|
||||
// this case!
|
||||
gSems[slot].owner = team;
|
||||
|
||||
RELEASE_SEM_LOCK(gSems[slot]);
|
||||
|
||||
Reference in New Issue
Block a user