am 96cd50f2: am 0e32e39d: Merge "Fix pthread key num calculation."

* commit '96cd50f2fc33b0d342f1733894b06fd59a725519':
  Fix pthread key num calculation.
This commit is contained in:
Yabin Cui
2014-12-13 03:03:51 +00:00
committed by Android Git Automerger
5 changed files with 38 additions and 22 deletions

View File

@@ -50,7 +50,6 @@
#endif
static pthread_key_t _res_key;
static pthread_once_t _res_once = PTHREAD_ONCE_INIT;
typedef struct {
int _h_errno;
@@ -105,6 +104,7 @@ _res_thread_free( void* _rt )
free(rt);
}
__attribute__((constructor))
static void
_res_init_key( void )
{
@@ -115,7 +115,6 @@ static _res_thread*
_res_thread_get(void)
{
_res_thread* rt;
pthread_once( &_res_once, _res_init_key );
rt = pthread_getspecific( _res_key );
if (rt != NULL) {