Revert "Pull the pthread_key_t functions out of pthread.c."
This reverts commit ad59322ae4
somehow my unfinished libm/Android.mk change got into here.
Change-Id: I46be626c5269d60fb1ced9862f2ebaa380b4e0af
This commit is contained in:
committed by
Gerrit Code Review
parent
ad59322ae4
commit
6260553d48
@@ -28,25 +28,6 @@ TEST(pthread, pthread_key_create) {
|
||||
ASSERT_EQ(EINVAL, pthread_key_delete(key));
|
||||
}
|
||||
|
||||
TEST(pthread, pthread_key_create_lots) {
|
||||
// We can allocate _SC_THREAD_KEYS_MAX keys.
|
||||
std::vector<pthread_key_t> keys;
|
||||
for (int i = 0; i < sysconf(_SC_THREAD_KEYS_MAX); ++i) {
|
||||
pthread_key_t key;
|
||||
ASSERT_EQ(0, pthread_key_create(&key, NULL));
|
||||
keys.push_back(key);
|
||||
}
|
||||
|
||||
// ...and that really is the maximum.
|
||||
pthread_key_t key;
|
||||
ASSERT_EQ(EAGAIN, pthread_key_create(&key, NULL));
|
||||
|
||||
// (Don't leak all those keys!)
|
||||
for (size_t i = 0; i < keys.size(); ++i) {
|
||||
ASSERT_EQ(0, pthread_key_delete(keys[i]));
|
||||
}
|
||||
}
|
||||
|
||||
static void* IdFn(void* arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user