summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-03-10 18:13:14 -0800
committerSteve Kondik <steve@cyngn.com>2016-03-10 18:13:14 -0800
commitf6164e6c266759ab0cd9e7e491326d3c0974dfbd (patch)
tree7b3355fbfaa5a1e44d9488d112c063ad208d2fc9
parentf6f044521265ce0161276c42ea8f87d1ab6570cf (diff)
parent1a5bfd9eaf22eaf9fcc54d3065d0e88bff4f3e42 (diff)
downloadbionic-f6164e6c266759ab0cd9e7e491326d3c0974dfbd.zip
bionic-f6164e6c266759ab0cd9e7e491326d3c0974dfbd.tar.gz
bionic-f6164e6c266759ab0cd9e7e491326d3c0974dfbd.tar.bz2
Merge tag 'android-6.0.1_r22' of https://android.googlesource.com/platform/bionic into cm-13.0
Android 6.0.1 release 22
-rwxr-xr-x[-rw-r--r--]tests/pthread_test.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index ad8fac6..e210255 100644..100755
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -1245,8 +1245,11 @@ TEST(pthread, pthread_attr_getstack_18908062) {
}
#if defined(__BIONIC__)
+static pthread_mutex_t gettid_mutex;
static void* pthread_gettid_np_helper(void* arg) {
+ pthread_mutex_lock(&gettid_mutex);
*reinterpret_cast<pid_t*>(arg) = gettid();
+ pthread_mutex_unlock(&gettid_mutex);
return NULL;
}
#endif
@@ -1257,11 +1260,15 @@ TEST(pthread, pthread_gettid_np) {
pid_t t_gettid_result;
pthread_t t;
+ pthread_mutex_init(&gettid_mutex, NULL);
+ pthread_mutex_lock(&gettid_mutex);
pthread_create(&t, NULL, pthread_gettid_np_helper, &t_gettid_result);
pid_t t_pthread_gettid_np_result = pthread_gettid_np(t);
+ pthread_mutex_unlock(&gettid_mutex);
pthread_join(t, NULL);
+ pthread_mutex_destroy(&gettid_mutex);
ASSERT_EQ(t_gettid_result, t_pthread_gettid_np_result);
#else