summaryrefslogtreecommitdiffstats
path: root/sys/sys/_semaphore.h
Commit message (Collapse)AuthorAgeFilesLines
* Use umtx to implement process sharable semaphore, to make this work,davidxu2010-01-051-19/+2
| | | | | | | | | | | | | | | | | | | | | | now type sema_t is a structure which can be put in a shared memory area, and multiple processes can operate it concurrently. User can either use mmap(MAP_SHARED) + sem_init(pshared=1) or use sem_open() to initialize a shared semaphore. Named semaphore uses file system and is located in /tmp directory, and its file name is prefixed with 'SEMD', so now it is chroot or jail friendly. In simplist cases, both for named and un-named semaphore, userland code does not have to enter kernel to reduce/increase semaphore's count. The semaphore is designed to be crash-safe, it means even if an application is crashed in the middle of operating semaphore, the semaphore state is still safely recovered by later use, there is no waiter counter maintained by userland code. The main semaphore code is in libc and libthr only has some necessary stubs, this makes it possible that a non-threaded application can use semaphore without linking to thread library. Old semaphore implementation is kept libc to maintain binary compatibility. The kernel ksem API is no longer used in the new implemenation. Discussed on: threads@
* Const-qualify ksem_timedwait's parameter abstime as it's only passed in.stefanf2005-10-181-1/+1
|
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* The sem_timedwait() and ksem_timedwait() functions bothdeischen2004-02-031-0/+1
| | | | | | need struct timespec, so define it here. Discussed in: standards (wollman)
* Add ksem_timedwait() to complement ksem_wait().deischen2004-02-031-0/+1
| | | | Glanced at by: alfred
* Add the rest of the kernel support for the sem_ API in kern/uipc_sem.c.alfred2002-09-191-0/+71
Option 'P1003_1B_SEMAPHORES' to compile them in, or load the "sem" module to activate them. Have kern/makesyscalls.sh emit an include for sys/_semaphore.h into sysproto.h to pull in the typedef for semid_t. Add the syscalls to the syscall table as module stubs.
OpenPOWER on IntegriCloud