Added and implemented new system calls switch_sem() and switch_sem_etc(); even if

they are public now, they might become private later on.
It's almost the same as acquire_sem() but allows you to release another semaphore
atomically. This makes condvar implementations and the like very simple to do.
Added B_CHECK_PERMISSION flags to the user calls, although it's not honored yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11887 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-03-17 22:35:00 +00:00
parent 63531836b9
commit 34e92cad76
5 changed files with 70 additions and 8 deletions
+5
View File
@@ -170,6 +170,11 @@ extern status_t acquire_sem(sem_id id);
extern status_t acquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout);
extern status_t release_sem(sem_id id);
extern status_t release_sem_etc(sem_id id, int32 count, uint32 flags);
// ToDo: the following two calls are not part of the BeOS API, and might be
// changed or even removed for the final release of Haiku R1
extern status_t switch_sem(sem_id semToBeReleased, sem_id id);
extern status_t switch_sem_etc(sem_id semToBeReleased, sem_id id, int32 count,
uint32 flags, bigtime_t timeout);
extern status_t get_sem_count(sem_id id, int32 *threadCount);
extern status_t set_sem_owner(sem_id id, team_id team);