1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

htl: Add pshared semaphore support

The implementation is extremely similar to the nptl implementation, but
with slight differences in the futex interface. This fixes some of BZ
25521.
This commit is contained in:
Samuel Thibault
2020-12-13 15:14:40 +00:00
parent 644d98ec4d
commit c8f9421298
11 changed files with 286 additions and 185 deletions

View File

@@ -24,12 +24,6 @@
int
__sem_init (sem_t *sem, int pshared, unsigned value)
{
if (pshared != 0)
{
errno = EOPNOTSUPP;
return -1;
}
#ifdef SEM_VALUE_MAX
if (value > SEM_VALUE_MAX)
{
@@ -38,7 +32,9 @@ __sem_init (sem_t *sem, int pshared, unsigned value)
}
#endif
*sem = (sem_t) __SEMAPHORE_INITIALIZER (pshared, value);
struct new_sem *isem = (struct new_sem *) sem;
*isem = (struct new_sem) __SEMAPHORE_INITIALIZER (value, pshared);
return 0;
}