summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/sem.c
Commit message (Collapse)AuthorAgeFilesLines
* Prevent memory leak on sem_destroy() by destroying the semaphore'sdeischen2004-02-061-1/+4
| | | | internal mutex and CV.
* Only allow the semaphore to be taken when the value is positive.deischen2004-02-061-2/+1
| | | | | | Don't decrement it twice when it is taken. Reported by: kris
* Correct check for invalid semaphore on sem_destroy() (s/==/!=/).deischen2004-02-051-1/+1
| | | | Reported by: kris
* Correct the weak reference for sem_unlink.deischen2004-02-051-1/+1
|
* Allow libc's version of sem_trywait() to work for non-pshared mutexes.deischen2004-02-041-2/+17
|
* Modify the implementation of libc semaphores so that they can bedeischen2004-02-031-146/+132
| | | | | | | | | | | | overridden by the threads library to provide a userland version of non-pshared semaphores and cancellation points. Also add a sem_timedwait(). The libc version of semaphores always uses kernel semaphores regardless of whether pshared is set or not. When threads are not present, it is difficult to get sem_wait() or sem_timedwait() to do the right thing (since pthread_cond_timedwait() and pthread_cond_wait() are stubs in libc and just return immediately).
* Backout revision 1.6, because some stub functions not in libc, anddavidxu2004-01-171-18/+2
| | | | | non-threaded won't build. The cancellation point support should be further discussed.
* Enable cancellation point in sem_wait, it is required by POSIX.davidxu2004-01-171-2/+18
| | | | | | For pshared semaphore, this commit still does not enable cancellation point, I think there should be a pthread_enter_cancellation_point_np for libc to implement a safe cancellation point.
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).nectar2003-02-161-0/+2
| | | | | | | Only warnings that could be fixed without changing the generated object code and without restructuring the source code have been handled. Reviewed by: /sbin/md5
* Add the newly created semaphore to the named semaphore list in sem_open()tjr2003-01-141-1/+2
| | | | | | so that multiple opens of the same semaphore without an intervening sem_close() return the same object, and so that sem_close() does not segfault while trying to remove the item from the list.
* Add restrict type-qualifier to sem_getvalue().mike2002-10-041-1/+1
|
* Welcome the sem_ API to libc!alfred2002-09-191-0/+354
OpenPOWER on IntegriCloud