Reimplement unnamed POSIX semaphores using user_mutex

* Fixes sharing semantics, so non-shared semaphores in non-shared
  memory do not become shared after a fork.
* Adds two new system calls: _user_mutex_sem_acquire/release(),
  which reuse the user_mutex address-hashed wait mechanism.
* Named semaphores continue to use traditional sem_id semaphores.
This commit is contained in:
Hamish Morrison
2015-05-24 14:03:40 +01:00
parent 03796a0cef
commit d6d439f3f7
6 changed files with 286 additions and 291 deletions
+3
View File
@@ -79,6 +79,9 @@ extern status_t _kern_mutex_lock(int32* mutex, const char* name,
extern status_t _kern_mutex_unlock(int32* mutex, uint32 flags);
extern status_t _kern_mutex_switch_lock(int32* fromMutex, int32* toMutex,
const char* name, uint32 flags, bigtime_t timeout);
extern status_t _kern_mutex_sem_acquire(int32* sem, const char* name,
uint32 flags, bigtime_t timeout);
extern status_t _kern_mutex_sem_release(int32* sem);
/* sem functions */
extern sem_id _kern_create_sem(int count, const char *name);