mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
htl: Add support for semaphore maximum value
This commit is contained in:
parent
819bb5e660
commit
5e77ec7c6e
@ -30,6 +30,13 @@ __sem_post (sem_t *sem)
|
||||
if (sem->__value > 0)
|
||||
/* Do a quick up. */
|
||||
{
|
||||
if (sem->__value == SEM_VALUE_MAX)
|
||||
{
|
||||
__pthread_spin_unlock (&sem->__lock);
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
|
||||
assert (sem->__queue == NULL);
|
||||
sem->__value++;
|
||||
__pthread_spin_unlock (&sem->__lock);
|
||||
|
@ -41,3 +41,6 @@
|
||||
|
||||
/* The number of threads per process. */
|
||||
#define _POSIX_THREAD_THREADS_MAX 64
|
||||
|
||||
/* Maximum value the semaphore can have. */
|
||||
#define SEM_VALUE_MAX (2147483647)
|
||||
|
Loading…
Reference in New Issue
Block a user