summaryrefslogtreecommitdiff
path: root/include/utils
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-07-30 16:34:47 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-07-30 16:34:47 +0000
commite6e71608bd60b4745b048ec466b5ea1301020b32 (patch)
tree62aaf762c22798dceb58494ca621bf99660a2278 /include/utils
parent44443bead6cf3c6e71029e7181f64ba82c6a8c8e (diff)
parent9b828adfad09200f3f1bd3602187fe3dd5335774 (diff)
Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/AndroidThreads.h2
-rw-r--r--include/utils/Mutex.h4
-rw-r--r--include/utils/Thread.h4
-rw-r--r--include/utils/Trace.h6
4 files changed, 8 insertions, 8 deletions
diff --git a/include/utils/AndroidThreads.h b/include/utils/AndroidThreads.h
index aad1e82cb..4c2dd49f6 100644
--- a/include/utils/AndroidThreads.h
+++ b/include/utils/AndroidThreads.h
@@ -73,7 +73,7 @@ extern void androidSetCreateThreadFunc(android_create_thread_fn func);
// ------------------------------------------------------------------
// Extra functions working with raw pids.
-#ifdef HAVE_ANDROID_OS
+#if defined(__ANDROID__)
// Change the priority AND scheduling group of a particular thread. The priority
// should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION
// if the priority set failed, else another value if just the group set failed;
diff --git a/include/utils/Mutex.h b/include/utils/Mutex.h
index 757519b08..f027c799f 100644
--- a/include/utils/Mutex.h
+++ b/include/utils/Mutex.h
@@ -59,7 +59,7 @@ public:
// lock if possible; returns 0 on success, error otherwise
status_t tryLock();
-#if HAVE_ANDROID_OS
+#if defined(__ANDROID__)
// lock the mutex, but don't wait longer than timeoutMilliseconds.
// Returns 0 on success, TIMED_OUT for failure due to timeout expiration.
//
@@ -128,7 +128,7 @@ inline void Mutex::unlock() {
inline status_t Mutex::tryLock() {
return -pthread_mutex_trylock(&mMutex);
}
-#if HAVE_ANDROID_OS
+#if defined(__ANDROID__)
inline status_t Mutex::timedLock(nsecs_t timeoutNs) {
const struct timespec ts = {
/* .tv_sec = */ static_cast<time_t>(timeoutNs / 1000000000),
diff --git a/include/utils/Thread.h b/include/utils/Thread.h
index 28839fded..1532b7e0c 100644
--- a/include/utils/Thread.h
+++ b/include/utils/Thread.h
@@ -70,7 +70,7 @@ public:
// Indicates whether this thread is running or not.
bool isRunning() const;
-#ifdef HAVE_ANDROID_OS
+#if defined(__ANDROID__)
// Return the thread's kernel ID, same as the thread itself calling gettid(),
// or -1 if the thread is not running.
pid_t getTid() const;
@@ -101,7 +101,7 @@ private:
volatile bool mExitPending;
volatile bool mRunning;
sp<Thread> mHoldSelf;
-#ifdef HAVE_ANDROID_OS
+#if defined(__ANDROID__)
// legacy for debugging, not used by getTid() as it is set by the child thread
// and so is not initialized until the child reaches that point
pid_t mTid;
diff --git a/include/utils/Trace.h b/include/utils/Trace.h
index 6ee343d79..6ba68f61c 100644
--- a/include/utils/Trace.h
+++ b/include/utils/Trace.h
@@ -17,7 +17,7 @@
#ifndef ANDROID_TRACE_H
#define ANDROID_TRACE_H
-#ifdef HAVE_ANDROID_OS
+#if defined(__ANDROID__)
#include <fcntl.h>
#include <stdint.h>
@@ -59,11 +59,11 @@ private:
}; // namespace android
-#else // HAVE_ANDROID_OS
+#else // !__ANDROID__
#define ATRACE_NAME(...)
#define ATRACE_CALL()
-#endif // HAVE_ANDROID_OS
+#endif // __ANDROID__
#endif // ANDROID_TRACE_H