diff options
author | theraven <theraven@FreeBSD.org> | 2013-07-10 16:28:24 +0000 |
---|---|---|
committer | theraven <theraven@FreeBSD.org> | 2013-07-10 16:28:24 +0000 |
commit | 214e4f8fe625ad54aac3b215909e0b994a5768ec (patch) | |
tree | f757844d307e5ebbf92ab857f2376cceb7807147 /contrib/libcxxrt/exception.cc | |
parent | c660176671bf640bee3fd09dbfa32ad187a9b942 (diff) | |
download | FreeBSD-src-214e4f8fe625ad54aac3b215909e0b994a5768ec.zip FreeBSD-src-214e4f8fe625ad54aac3b215909e0b994a5768ec.tar.gz |
Import new libcxxrt / libc++. This brings some bug fixes, including a potential race condition for static initialisers.
Diffstat (limited to 'contrib/libcxxrt/exception.cc')
-rw-r--r-- | contrib/libcxxrt/exception.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc index 50ee582..c1cb243 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. * |