am a12c5445
: Fix unused warnings in pthread.c
* commit 'a12c54454f3a6132988b68873903f6e9eed7f384': Fix unused warnings in pthread.c
This commit is contained in:
commit
801aeefe2d
1 changed files with 12 additions and 18 deletions
|
@ -450,22 +450,18 @@ int pthread_attr_getstacksize(pthread_attr_t const * attr, size_t * stack_size)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pthread_attr_setstackaddr(pthread_attr_t * attr, void * stack_addr)
|
||||
int pthread_attr_setstackaddr(pthread_attr_t * attr __attribute__((unused)),
|
||||
void * stack_addr __attribute__((unused)))
|
||||
{
|
||||
#if 1
|
||||
// It's not clear if this is setting the top or bottom of the stack, so don't handle it for now.
|
||||
// This was removed from POSIX.1-2008, and is not implemented on bionic.
|
||||
// Needed for ABI compatibility with the NDK.
|
||||
return ENOSYS;
|
||||
#else
|
||||
if ((uint32_t)stack_addr & (PAGE_SIZE - 1)) {
|
||||
return EINVAL;
|
||||
}
|
||||
attr->stack_base = stack_addr;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int pthread_attr_getstackaddr(pthread_attr_t const * attr, void ** stack_addr)
|
||||
{
|
||||
// This was removed from POSIX.1-2008.
|
||||
// Needed for ABI compatibility with the NDK.
|
||||
*stack_addr = (char*)attr->stack_base + attr->stack_size;
|
||||
return 0;
|
||||
}
|
||||
|
@ -513,7 +509,7 @@ int pthread_getattr_np(pthread_t thid, pthread_attr_t * attr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pthread_attr_setscope(pthread_attr_t *attr, int scope)
|
||||
int pthread_attr_setscope(pthread_attr_t *attr __attribute__((unused)), int scope)
|
||||
{
|
||||
if (scope == PTHREAD_SCOPE_SYSTEM)
|
||||
return 0;
|
||||
|
@ -523,7 +519,7 @@ int pthread_attr_setscope(pthread_attr_t *attr, int scope)
|
|||
return EINVAL;
|
||||
}
|
||||
|
||||
int pthread_attr_getscope(pthread_attr_t const *attr)
|
||||
int pthread_attr_getscope(pthread_attr_t const *attr __attribute__((unused)))
|
||||
{
|
||||
return PTHREAD_SCOPE_SYSTEM;
|
||||
}
|
||||
|
@ -1181,7 +1177,7 @@ _recursive_increment(pthread_mutex_t* mutex, int mvalue, int mtype)
|
|||
__LIBC_HIDDEN__
|
||||
int pthread_mutex_lock_impl(pthread_mutex_t *mutex)
|
||||
{
|
||||
int mvalue, mtype, tid, new_lock_type, shared;
|
||||
int mvalue, mtype, tid, shared;
|
||||
|
||||
if (__unlikely(mutex == NULL))
|
||||
return EINVAL;
|
||||
|
@ -1275,7 +1271,7 @@ int pthread_mutex_lock(pthread_mutex_t *mutex)
|
|||
__LIBC_HIDDEN__
|
||||
int pthread_mutex_unlock_impl(pthread_mutex_t *mutex)
|
||||
{
|
||||
int mvalue, mtype, tid, oldv, shared;
|
||||
int mvalue, mtype, tid, shared;
|
||||
|
||||
if (__unlikely(mutex == NULL))
|
||||
return EINVAL;
|
||||
|
@ -1342,7 +1338,7 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
|||
__LIBC_HIDDEN__
|
||||
int pthread_mutex_trylock_impl(pthread_mutex_t *mutex)
|
||||
{
|
||||
int mvalue, mtype, tid, oldv, shared;
|
||||
int mvalue, mtype, tid, shared;
|
||||
|
||||
if (__unlikely(mutex == NULL))
|
||||
return EINVAL;
|
||||
|
@ -1437,7 +1433,7 @@ int pthread_mutex_lock_timeout_np_impl(pthread_mutex_t *mutex, unsigned msecs)
|
|||
clockid_t clock = CLOCK_MONOTONIC;
|
||||
struct timespec abstime;
|
||||
struct timespec ts;
|
||||
int mvalue, mtype, tid, oldv, new_lock_type, shared;
|
||||
int mvalue, mtype, tid, shared;
|
||||
|
||||
/* compute absolute expiration time */
|
||||
__timespec_to_relative_msec(&abstime, msecs, clock);
|
||||
|
@ -2118,9 +2114,7 @@ int pthread_getcpuclockid(pthread_t tid, clockid_t *clockid)
|
|||
*/
|
||||
int pthread_once( pthread_once_t* once_control, void (*init_routine)(void) )
|
||||
{
|
||||
static pthread_mutex_t once_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
|
||||
volatile pthread_once_t* ocptr = once_control;
|
||||
pthread_once_t value;
|
||||
|
||||
/* PTHREAD_ONCE_INIT is 0, we use the following bit flags
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue