fix sem_open and sem_close to obey posix semantics
multiple opens of the same named semaphore must return the same pointer, and only the last close can unmap it. thus the ugly global state keeping track of mappings. the maximum number of distinct named semaphores that can be opened is limited sufficiently small that the linear searches take trivial time, especially compared to the syscall overhead of these functions.
This commit is contained in:
parent
5fcebcde6a
commit
81af503610
4 changed files with 86 additions and 38 deletions
|
|
@ -30,6 +30,7 @@
|
|||
#define PTHREAD_STACK_MIN PAGE_SIZE
|
||||
#define PTHREAD_DESTRUCTOR_ITERATIONS 4
|
||||
#define SEM_VALUE_MAX 0x7fffffff
|
||||
#define SEM_NSEMS_MAX 256
|
||||
|
||||
/* Arbitrary numbers... */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue