diff options
author | Yabin Cui <yabinc@google.com> | 2015-01-28 00:42:36 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-28 00:42:36 +0000 |
commit | 3f83554d220300a399c084d8b7b48a21c4402feb (patch) | |
tree | 6153e395c5aac95d4dc2c4b86e6dbc8caa053bd7 /include | |
parent | a0b7380673a9a6e0b9fc404b1f59da60433ff54e (diff) | |
parent | 631965a32eb503dc6782a298eb534881aa3697b8 (diff) | |
download | system_core-3f83554d220300a399c084d8b7b48a21c4402feb.zip system_core-3f83554d220300a399c084d8b7b48a21c4402feb.tar.gz system_core-3f83554d220300a399c084d8b7b48a21c4402feb.tar.bz2 |
am 631965a3: am e862350b: Merge "Kill HAVE_PTHREADS."
* commit '631965a32eb503dc6782a298eb534881aa3697b8':
Kill HAVE_PTHREADS.
Diffstat (limited to 'include')
-rw-r--r-- | include/cutils/threads.h | 22 | ||||
-rw-r--r-- | include/log/log.h | 6 | ||||
-rw-r--r-- | include/log/logd.h | 15 | ||||
-rw-r--r-- | include/utils/AndroidThreads.h | 2 | ||||
-rw-r--r-- | include/utils/Condition.h | 8 | ||||
-rw-r--r-- | include/utils/Mutex.h | 8 | ||||
-rw-r--r-- | include/utils/RWLock.h | 6 | ||||
-rw-r--r-- | include/utils/Thread.h | 2 |
8 files changed, 33 insertions, 36 deletions
diff --git a/include/cutils/threads.h b/include/cutils/threads.h index acf8f48..ade9a0c 100644 --- a/include/cutils/threads.h +++ b/include/cutils/threads.h @@ -29,7 +29,7 @@ extern "C" { /***********************************************************************/ /***********************************************************************/ -#ifdef HAVE_PTHREADS +#if !defined(_WIN32) #include <pthread.h> @@ -42,7 +42,7 @@ typedef struct { #define THREAD_STORE_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0 } -#elif defined HAVE_WIN32_THREADS +#else // !defined(_WIN32) #include <windows.h> @@ -56,15 +56,13 @@ typedef struct { #define THREAD_STORE_INITIALIZER { 0, 0, 0, {0, 0, 0, 0, 0, 0} } -#else -# error "no thread_store_t implementation for your platform !!" -#endif +#endif // !defined(_WIN32) typedef void (*thread_store_destruct_t)(void* value); extern void* thread_store_get(thread_store_t* store); -extern void thread_store_set(thread_store_t* store, +extern void thread_store_set(thread_store_t* store, void* value, thread_store_destruct_t destroy); @@ -76,7 +74,7 @@ extern void thread_store_set(thread_store_t* store, /***********************************************************************/ /***********************************************************************/ -#ifdef HAVE_PTHREADS +#if !defined(_WIN32) typedef pthread_mutex_t mutex_t; @@ -98,10 +96,10 @@ static __inline__ void mutex_destroy(mutex_t* lock) { pthread_mutex_destroy(lock); } -#endif -#ifdef HAVE_WIN32_THREADS -typedef struct { +#else // !defined(_WIN32) + +typedef struct { int init; CRITICAL_SECTION lock[1]; } mutex_t; @@ -134,10 +132,10 @@ static __inline__ void mutex_destroy(mutex_t* lock) { if (lock->init) { lock->init = 0; - DeleteCriticalSection(lock->lock); + DeleteCriticalSection(lock->lock); } } -#endif +#endif // !defined(_WIN32) #ifdef __cplusplus } diff --git a/include/log/log.h b/include/log/log.h index ace12d6..3d86533 100644 --- a/include/log/log.h +++ b/include/log/log.h @@ -28,14 +28,12 @@ #ifndef _LIBS_LOG_LOG_H #define _LIBS_LOG_LOG_H -#include <sys/types.h> -#ifdef HAVE_PTHREADS -#include <pthread.h> -#endif #include <stdarg.h> #include <stdio.h> +#include <sys/types.h> #include <time.h> #include <unistd.h> + #include <log/logd.h> #include <log/uio.h> diff --git a/include/log/logd.h b/include/log/logd.h index 2e6f220..0fe515f 100644 --- a/include/log/logd.h +++ b/include/log/logd.h @@ -23,16 +23,17 @@ #include <android/log.h> /* the rest is only used internally by the system */ -#include <time.h> -#include <stdio.h> -#include <unistd.h> -#include <stdint.h> -#include <sys/types.h> -#ifdef HAVE_PTHREADS +#if !defined(_WIN32) #include <pthread.h> #endif -#include <log/uio.h> #include <stdarg.h> +#include <stdint.h> +#include <stdio.h> +#include <sys/types.h> +#include <time.h> +#include <unistd.h> + +#include <log/uio.h> #ifdef __cplusplus extern "C" { diff --git a/include/utils/AndroidThreads.h b/include/utils/AndroidThreads.h index 3c640b6..aad1e82 100644 --- a/include/utils/AndroidThreads.h +++ b/include/utils/AndroidThreads.h @@ -20,7 +20,7 @@ #include <stdint.h> #include <sys/types.h> -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) # include <pthread.h> #endif diff --git a/include/utils/Condition.h b/include/utils/Condition.h index db9be59..5a72519 100644 --- a/include/utils/Condition.h +++ b/include/utils/Condition.h @@ -21,7 +21,7 @@ #include <sys/types.h> #include <time.h> -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) # include <pthread.h> #endif @@ -74,7 +74,7 @@ public: void broadcast(); private: -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) pthread_cond_t mCond; #else void* mState; @@ -83,7 +83,7 @@ private: // --------------------------------------------------------------------------- -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) inline Condition::Condition() { pthread_cond_init(&mCond, NULL); @@ -149,7 +149,7 @@ inline void Condition::broadcast() { pthread_cond_broadcast(&mCond); } -#endif // HAVE_PTHREADS +#endif // !defined(_WIN32) // --------------------------------------------------------------------------- }; // namespace android diff --git a/include/utils/Mutex.h b/include/utils/Mutex.h index a3b594d..757519b 100644 --- a/include/utils/Mutex.h +++ b/include/utils/Mutex.h @@ -21,7 +21,7 @@ #include <sys/types.h> #include <time.h> -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) # include <pthread.h> #endif @@ -87,7 +87,7 @@ private: Mutex(const Mutex&); Mutex& operator = (const Mutex&); -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) pthread_mutex_t mMutex; #else void _init(); @@ -97,7 +97,7 @@ private: // --------------------------------------------------------------------------- -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) inline Mutex::Mutex() { pthread_mutex_init(&mMutex, NULL); @@ -138,7 +138,7 @@ inline status_t Mutex::timedLock(nsecs_t timeoutNs) { } #endif -#endif // HAVE_PTHREADS +#endif // !defined(_WIN32) // --------------------------------------------------------------------------- diff --git a/include/utils/RWLock.h b/include/utils/RWLock.h index 90beb5f..e743b1c 100644 --- a/include/utils/RWLock.h +++ b/include/utils/RWLock.h @@ -20,7 +20,7 @@ #include <stdint.h> #include <sys/types.h> -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) # include <pthread.h> #endif @@ -31,7 +31,7 @@ namespace android { // --------------------------------------------------------------------------- -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) /* * Simple mutex class. The implementation is system-dependent. @@ -117,7 +117,7 @@ inline void RWLock::unlock() { pthread_rwlock_unlock(&mRWLock); } -#endif // HAVE_PTHREADS +#endif // !defined(_WIN32) // --------------------------------------------------------------------------- }; // namespace android diff --git a/include/utils/Thread.h b/include/utils/Thread.h index c867e95..28839fd 100644 --- a/include/utils/Thread.h +++ b/include/utils/Thread.h @@ -21,7 +21,7 @@ #include <sys/types.h> #include <time.h> -#if defined(HAVE_PTHREADS) +#if !defined(_WIN32) # include <pthread.h> #endif |