THRIFT-916 partial commit of v3-fix-all-warnings.patch and member initialization in Thrift.h


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1027092 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/concurrency/Mutex.cpp b/lib/cpp/src/concurrency/Mutex.cpp
index 6d71710..8d52452 100644
--- a/lib/cpp/src/concurrency/Mutex.cpp
+++ b/lib/cpp/src/concurrency/Mutex.cpp
@@ -189,6 +189,7 @@
   assert(ret == 0);
 }
 
+#if defined(PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP) || defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
 static void init_with_kind(pthread_mutex_t* mutex, int kind) {
   pthread_mutexattr_t mutexattr;
   int ret = pthread_mutexattr_init(&mutexattr);
@@ -204,6 +205,7 @@
   ret = pthread_mutexattr_destroy(&mutexattr);
   assert(ret == 0);
 }
+#endif
 
 #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
 void Mutex::ADAPTIVE_INITIALIZER(void* arg) {