diff options
Diffstat (limited to 'contrib/libcxxrt/exception.cc')
-rw-r--r-- | contrib/libcxxrt/exception.cc | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc index 7f0d3e8b0f6a..d84890599619 100644 --- a/contrib/libcxxrt/exception.cc +++ b/contrib/libcxxrt/exception.cc @@ -39,6 +39,24 @@ #pragma weak pthread_setspecific #pragma weak pthread_getspecific #pragma weak pthread_once +#ifdef LIBCXXRT_WEAK_LOCKS +#pragma weak pthread_mutex_lock +#define pthread_mutex_lock(mtx) do {\ + if (pthread_mutex_lock) pthread_mutex_lock(mtx);\ + } while(0) +#pragma weak pthread_mutex_unlock +#define pthread_mutex_unlock(mtx) do {\ + if (pthread_mutex_unlock) pthread_mutex_unlock(mtx);\ + } while(0) +#pragma weak pthread_cond_signal +#define pthread_cond_signal(cv) do {\ + if (pthread_cond_signal) pthread_cond_signal(cv);\ + } while(0) +#pragma weak pthread_cond_wait +#define pthread_cond_wait(cv, mtx) do {\ + if (pthread_cond_wait) pthread_cond_wait(cv, mtx);\ + } while(0) +#endif using namespace ABI_NAMESPACE; @@ -214,8 +232,6 @@ namespace std } -extern "C" std::type_info *__cxa_current_exception_type(); - /** * Class of exceptions to distinguish between this and other exception types. * @@ -699,7 +715,9 @@ static void report_failure(_Unwind_Reason_Code err, __cxa_exception *thrown_exce if (status == 0) { free(demangled); } // Print a back trace if no handler is found. // TODO: Make this optional +#ifndef __arm__ _Unwind_Backtrace(trace, 0); +#endif break; } std::terminate(); @@ -1404,7 +1422,7 @@ namespace std */ void terminate() { - static __cxa_thread_info *info = thread_info_fast(); + static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->terminateHandler) { info->terminateHandler(); @@ -1421,7 +1439,7 @@ namespace std */ void unexpected() { - static __cxa_thread_info *info = thread_info_fast(); + static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->unexpectedHandler) { info->unexpectedHandler(); |