OSDN Git Service

More pthreads cleanup.
authorElliott Hughes <enh@google.com>
Mon, 11 Feb 2013 20:34:03 +0000 (12:34 -0800)
committerElliott Hughes <enh@google.com>
Mon, 11 Feb 2013 22:56:39 +0000 (14:56 -0800)
commit2a1bb4e64677b9abbc17173c79768ed494565047
tree3e843fd4277f2bdc502511bd5e4ee539887c14f1
parent2d3e72336e76180fb00822386da4f14203d117ce
More pthreads cleanup.

POSIX says pthread_create returns EAGAIN, not ENOMEM.

Also pull pthread_attr_t functions into their own file.

Also pull pthread_setname_np into its own file.

Also remove unnecessary #includes from pthread_key.cpp.

Also account for those pthread keys used internally by bionic,
so they don't count against the number of keys available to user
code. (They do with glibc, but glibc's limit is the much more
generous 1024.)

Also factor out the common errno-restoring idiom to reduce gotos.

Bug: 6702535
Change-Id: I555e66efffcf2c1b5a2873569e91489156efca42
17 files changed:
libc/Android.mk
libc/bionic/dirent.cpp
libc/bionic/pthread.c
libc/bionic/pthread_attr.cpp [new file with mode: 0644]
libc/bionic/pthread_internal.h
libc/bionic/pthread_key.cpp
libc/bionic/pthread_setname_np.cpp [new file with mode: 0644]
libc/bionic/pthread_sigmask.cpp
libc/bionic/strerror_r.cpp
libc/bionic/stubs.cpp
libc/bionic/sysconf.cpp
libc/bionic/tmpfile.cpp
libc/private/ErrnoRestorer.h [new file with mode: 0644]
libc/private/ThreadLocalBuffer.h
libc/private/bionic_futex.h
libc/private/bionic_tls.h
tests/pthread_test.cpp