mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
nptl: Replace lll_futex_wake with futex-internal.h
The idea is to make NPTL implementation to use on the functions provided by futex-internal.h. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
This commit is contained in:
@ -84,19 +84,14 @@ int
|
||||
attribute_compat_text_section
|
||||
__old_sem_post (sem_t *sem)
|
||||
{
|
||||
int *futex = (int *) sem;
|
||||
unsigned int *futex = (unsigned int *) sem;
|
||||
|
||||
/* We must need to synchronize with consumers of this token, so the atomic
|
||||
increment must have release MO semantics. */
|
||||
atomic_write_barrier ();
|
||||
(void) atomic_increment_val (futex);
|
||||
/* We always have to assume it is a shared semaphore. */
|
||||
int err = lll_futex_wake (futex, 1, LLL_SHARED);
|
||||
if (__builtin_expect (err, 0) < 0)
|
||||
{
|
||||
__set_errno (-err);
|
||||
return -1;
|
||||
}
|
||||
futex_wake (futex, 1, LLL_SHARED);
|
||||
return 0;
|
||||
}
|
||||
compat_symbol (libpthread, __old_sem_post, sem_post, GLIBC_2_0);
|
||||
|
Reference in New Issue
Block a user