summaryrefslogtreecommitdiff
path: root/system/lib/libcxxabi/src/cxa_guard.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-21 20:43:10 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-21 20:43:10 -0800
commit8aa6919b7acf0b4034735ac7ee597e946fefaf4d (patch)
tree3ba77ead655e88db79243d4e00abcc73df5d3402 /system/lib/libcxxabi/src/cxa_guard.cpp
parent06bfe6541d88fda62a6b531e16250c63d85dcfe6 (diff)
parent160cc728e0839e441897d951fa61020bc2176717 (diff)
merge incoming
Diffstat (limited to 'system/lib/libcxxabi/src/cxa_guard.cpp')
-rw-r--r--system/lib/libcxxabi/src/cxa_guard.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/system/lib/libcxxabi/src/cxa_guard.cpp b/system/lib/libcxxabi/src/cxa_guard.cpp
index 814aaeb1..e403b64a 100644
--- a/system/lib/libcxxabi/src/cxa_guard.cpp
+++ b/system/lib/libcxxabi/src/cxa_guard.cpp
@@ -28,7 +28,7 @@ namespace __cxxabiv1
namespace
{
-#if LIBCXXABI_ARMEABI
+#if __arm__
// A 32-bit, 4-byte-aligned static data value. The least significant 2 bits must
// be statically initialized to 0.
@@ -62,7 +62,7 @@ void set_initialized(guard_type* guard_object) {
pthread_mutex_t guard_mut = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t guard_cv = PTHREAD_COND_INITIALIZER;
-#if __APPLE__
+#if defined(__APPLE__) && !defined(__arm__)
typedef uint32_t lock_type;
@@ -100,7 +100,7 @@ set_lock(uint64_t& x, lock_type y)
#endif // __LITTLE_ENDIAN__
-#else // __APPLE__
+#else // !__APPLE__ || __arm__
typedef bool lock_type;
@@ -169,7 +169,7 @@ int __cxa_guard_acquire(guard_type* guard_object)
int result = *initialized == 0;
if (result)
{
-#if __APPLE__
+#if defined(__APPLE__) && !defined(__arm__)
const lock_type id = pthread_mach_thread_np(pthread_self());
lock_type lock = get_lock(*guard_object);
if (lock)
@@ -189,14 +189,14 @@ int __cxa_guard_acquire(guard_type* guard_object)
}
else
set_lock(*guard_object, id);
-#else // __APPLE__
+#else // !__APPLE__ || __arm__
while (get_lock(*guard_object))
if (pthread_cond_wait(&guard_cv, &guard_mut))
abort_message("__cxa_guard_acquire condition variable wait failed");
result = *initialized == 0;
if (result)
set_lock(*guard_object, true);
-#endif // __APPLE__
+#endif // !__APPLE__ || __arm__
}
if (pthread_mutex_unlock(&guard_mut))
abort_message("__cxa_guard_acquire failed to release mutex");