@@ -450,22 +450,18 @@ int pthread_attr_getstacksize(pthread_attr_t const * attr, size_t * stack_size)
450
450
return 0 ;
451
451
}
452
452
453
- int pthread_attr_setstackaddr (pthread_attr_t * attr , void * stack_addr )
453
+ int pthread_attr_setstackaddr (pthread_attr_t * attr __attribute__((unused )),
454
+ void * stack_addr __attribute__((unused )))
454
455
{
455
- #if 1
456
- // It's not clear if this is setting the top or bottom of the stack, so don't handle it for now .
456
+ // This was removed from POSIX.1-2008, and is not implemented on bionic.
457
+ // Needed for ABI compatibility with the NDK .
457
458
return ENOSYS ;
458
- #else
459
- if ((uint32_t )stack_addr & (PAGE_SIZE - 1 )) {
460
- return EINVAL ;
461
- }
462
- attr -> stack_base = stack_addr ;
463
- return 0 ;
464
- #endif
465
459
}
466
460
467
461
int pthread_attr_getstackaddr (pthread_attr_t const * attr , void * * stack_addr )
468
462
{
463
+ // This was removed from POSIX.1-2008.
464
+ // Needed for ABI compatibility with the NDK.
469
465
* stack_addr = (char * )attr -> stack_base + attr -> stack_size ;
470
466
return 0 ;
471
467
}
@@ -513,7 +509,7 @@ int pthread_getattr_np(pthread_t thid, pthread_attr_t * attr)
513
509
return 0 ;
514
510
}
515
511
516
- int pthread_attr_setscope (pthread_attr_t * attr , int scope )
512
+ int pthread_attr_setscope (pthread_attr_t * attr __attribute__(( unused )) , int scope )
517
513
{
518
514
if (scope == PTHREAD_SCOPE_SYSTEM )
519
515
return 0 ;
@@ -523,7 +519,7 @@ int pthread_attr_setscope(pthread_attr_t *attr, int scope)
523
519
return EINVAL ;
524
520
}
525
521
526
- int pthread_attr_getscope (pthread_attr_t const * attr )
522
+ int pthread_attr_getscope (pthread_attr_t const * attr __attribute__(( unused )) )
527
523
{
528
524
return PTHREAD_SCOPE_SYSTEM ;
529
525
}
@@ -1181,7 +1177,7 @@ _recursive_increment(pthread_mutex_t* mutex, int mvalue, int mtype)
1181
1177
__LIBC_HIDDEN__
1182
1178
int pthread_mutex_lock_impl (pthread_mutex_t * mutex )
1183
1179
{
1184
- int mvalue , mtype , tid , new_lock_type , shared ;
1180
+ int mvalue , mtype , tid , shared ;
1185
1181
1186
1182
if (__unlikely (mutex == NULL ))
1187
1183
return EINVAL ;
@@ -1275,7 +1271,7 @@ int pthread_mutex_lock(pthread_mutex_t *mutex)
1275
1271
__LIBC_HIDDEN__
1276
1272
int pthread_mutex_unlock_impl (pthread_mutex_t * mutex )
1277
1273
{
1278
- int mvalue , mtype , tid , oldv , shared ;
1274
+ int mvalue , mtype , tid , shared ;
1279
1275
1280
1276
if (__unlikely (mutex == NULL ))
1281
1277
return EINVAL ;
@@ -1342,7 +1338,7 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex)
1342
1338
__LIBC_HIDDEN__
1343
1339
int pthread_mutex_trylock_impl (pthread_mutex_t * mutex )
1344
1340
{
1345
- int mvalue , mtype , tid , oldv , shared ;
1341
+ int mvalue , mtype , tid , shared ;
1346
1342
1347
1343
if (__unlikely (mutex == NULL ))
1348
1344
return EINVAL ;
@@ -1437,7 +1433,7 @@ int pthread_mutex_lock_timeout_np_impl(pthread_mutex_t *mutex, unsigned msecs)
1437
1433
clockid_t clock = CLOCK_MONOTONIC ;
1438
1434
struct timespec abstime ;
1439
1435
struct timespec ts ;
1440
- int mvalue , mtype , tid , oldv , new_lock_type , shared ;
1436
+ int mvalue , mtype , tid , shared ;
1441
1437
1442
1438
/* compute absolute expiration time */
1443
1439
__timespec_to_relative_msec (& abstime , msecs , clock );
@@ -2118,9 +2114,7 @@ int pthread_getcpuclockid(pthread_t tid, clockid_t *clockid)
2118
2114
*/
2119
2115
int pthread_once ( pthread_once_t * once_control , void (* init_routine )(void ) )
2120
2116
{
2121
- static pthread_mutex_t once_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER ;
2122
2117
volatile pthread_once_t * ocptr = once_control ;
2123
- pthread_once_t value ;
2124
2118
2125
2119
/* PTHREAD_ONCE_INIT is 0, we use the following bit flags
2126
2120
*
0 commit comments