Merge "Revert "Cause Fatal error when invalid pthread_id is detected.""

This commit is contained in:
Yabin Cui
2015-03-26 18:14:22 +00:00
committed by Gerrit Code Review
2 changed files with 11 additions and 47 deletions

View File

@@ -81,16 +81,12 @@ void __pthread_internal_remove_and_free(pthread_internal_t* thread) {
pthread_internal_t* __pthread_internal_find(pthread_t thread_id) {
pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(thread_id);
{
ScopedPthreadMutexLocker locker(&g_thread_list_lock);
ScopedPthreadMutexLocker locker(&g_thread_list_lock);
for (pthread_internal_t* t = g_thread_list; t != NULL; t = t->next) {
if (t == thread) {
return thread;
}
for (pthread_internal_t* t = g_thread_list; t != NULL; t = t->next) {
if (t == thread) {
return thread;
}
}
// TODO: Remove g_thread_list/g_thread_list_lock when the fatal error below doesn't happen.
__libc_fatal("No such thread: %p", thread);
return NULL;
}