aboutsummaryrefslogtreecommitdiff
path: root/system/lib/libcxxabi/src/cxa_guard.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-10 12:34:54 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-21 10:47:39 -0800
commit34b153227d5343128cb36931b4dbb27e378372a5 (patch)
treec6f84632bd072e594f38d56a773f1b4496323dbc /system/lib/libcxxabi/src/cxa_guard.cpp
parente9fe31fb2f629a2b94809c7f9a91577425728b1e (diff)
update libcxxabi
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");