Let g_thread_list_lock only protect g_thread_list.

As glibc/netbsd don't protect access to thread struct members by a global
lock, we don't want to do it either. This change reduces the
responsibility of g_thread_list_lock to only protect g_thread_list.

Bug: 19636317
Change-Id: I897890710653dac165d8fa4452c7ecf74abdbf2b
This commit is contained in:
Yabin Cui
2015-03-19 14:19:19 -07:00
parent 4149dc944b
commit 673b15e4ee
14 changed files with 107 additions and 178 deletions

View File

@@ -29,13 +29,13 @@
#include <errno.h>
#include "private/ErrnoRestorer.h"
#include "pthread_accessor.h"
#include "pthread_internal.h"
int pthread_getschedparam(pthread_t t, int* policy, sched_param* param) {
ErrnoRestorer errno_restorer;
pthread_accessor thread(t);
if (thread.get() == NULL) {
pthread_internal_t* thread = __pthread_internal_find(t);
if (thread == NULL) {
return ESRCH;
}