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:
Axel Dörfler
2002-09-30 03:48:59 +00:00
parent 3fa1fa66f1
commit 634a41725a
+3
View File
@@ -739,6 +739,9 @@ set_sem_owner(sem_id id, team_id team)
return B_BAD_SEM_ID; 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; gSems[slot].owner = team;
RELEASE_SEM_LOCK(gSems[slot]); RELEASE_SEM_LOCK(gSems[slot]);