<pthread.h> fixes and pthread cleanup.

<pthread.h> was missing nonnull attributes, noreturn on pthread_exit,
and had incorrect cv qualifiers for several standard functions.

I've also marked the non-standard stuff (where I count glibc rather
than POSIX as "standard") so we can revisit this cruft for LP64 and
try to ensure we're compatible with glibc.

I've also broken out the pthread_cond* functions into a new file.

I've made the remaining pthread files (plus ptrace) part of the bionic code
and fixed all the warnings.

I've added a few more smoke tests for chunks of untested pthread functionality.

We no longer need the libc_static_common_src_files hack for any of the
pthread implementation because we long since stripped out the rest of
the armv5 support, and this hack was just to ensure that __get_tls in libc.a
went via the kernel if necessary.

This patch also finishes the job of breaking up the pthread.c monolith, and
adds a handful of new tests.

Change-Id: Idc0ae7f5d8aa65989598acd4c01a874fe21582c7
diff --git a/libc/Android.mk b/libc/Android.mk
index 116e08f..e860d17 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -133,7 +133,6 @@
 	bionic/system_properties_compat.c \
 	bionic/tcgetpgrp.c \
 	bionic/tcsetpgrp.c \
-	bionic/thread_atexit.c \
 	bionic/time64.c \
 	bionic/umount.c \
 	bionic/unlockpt.c \
@@ -242,18 +241,27 @@
     bionic/pause.cpp \
     bionic/pipe.cpp \
     bionic/poll.cpp \
+    bionic/pthread_atfork.cpp \
     bionic/pthread_attr.cpp \
+    bionic/pthread_cond.cpp \
+    bionic/pthread_create.cpp \
     bionic/pthread_detach.cpp \
     bionic/pthread_equal.cpp \
+    bionic/pthread_exit.cpp \
     bionic/pthread_getcpuclockid.cpp \
     bionic/pthread_getschedparam.cpp \
     bionic/pthread_internals.cpp \
     bionic/pthread_join.cpp \
+    bionic/pthread_key.cpp \
     bionic/pthread_kill.cpp \
+    bionic/pthread_mutex.cpp \
+    bionic/pthread_once.cpp \
+    bionic/pthread_rwlock.cpp \
     bionic/pthread_self.cpp \
     bionic/pthread_setname_np.cpp \
     bionic/pthread_setschedparam.cpp \
     bionic/pthread_sigmask.cpp \
+    bionic/ptrace.cpp \
     bionic/raise.cpp \
     bionic/readlink.cpp \
     bionic/rename.cpp \
@@ -285,8 +293,10 @@
     bionic/stubs.cpp \
     bionic/symlink.cpp \
     bionic/sysconf.cpp \
+    bionic/thread_atexit.cpp \
     bionic/tdestroy.cpp \
     bionic/__thread_entry.cpp \
+    bionic/timer.cpp \
     bionic/tmpfile.cpp \
     bionic/unlink.cpp \
     bionic/utimes.cpp \
@@ -414,17 +424,6 @@
     upstream-netbsd/libc/string/strxfrm.c \
     upstream-netbsd/libc/unistd/killpg.c \
 
-libc_common_src_files += \
-    bionic/pthread-atfork.c \
-    bionic/pthread-rwlocks.c \
-    bionic/pthread-timers.c \
-    bionic/ptrace.c \
-
-libc_static_common_src_files += \
-    bionic/pthread.c \
-    bionic/pthread_create.cpp \
-    bionic/pthread_key.cpp \
-
 # Architecture specific source files go here
 # =========================================================
 ifeq ($(TARGET_ARCH),arm)