diff options
| author | Dave Zarzycki <zarzycki@apple.com> | 2012-03-15 08:58:08 +0000 |
|---|---|---|
| committer | Dave Zarzycki <zarzycki@apple.com> | 2012-03-15 08:58:08 +0000 |
| commit | d6533ccd48957d81a13399a48cf01f88e4840bb0 (patch) | |
| tree | b4c4034e74f3aa37263f6599594c888da0e265a4 /libcxxabi/src/cxa_handlers.cpp | |
| parent | 13e35c086cc5988a8b5ab26f1ddfe9278783ae12 (diff) | |
| download | bcm5719-llvm-d6533ccd48957d81a13399a48cf01f88e4840bb0.tar.gz bcm5719-llvm-d6533ccd48957d81a13399a48cf01f88e4840bb0.zip | |
Less lame "concurrency" support
These APIs aren't thread safe, but they're pretending to be. Let's at
least make the getter as fast as they can be. The setters are a lost
cause unless the API can be fixed.
llvm-svn: 152786
Diffstat (limited to 'libcxxabi/src/cxa_handlers.cpp')
| -rw-r--r-- | libcxxabi/src/cxa_handlers.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxxabi/src/cxa_handlers.cpp b/libcxxabi/src/cxa_handlers.cpp index 1cfdfe7ae70..97f1347010e 100644 --- a/libcxxabi/src/cxa_handlers.cpp +++ b/libcxxabi/src/cxa_handlers.cpp @@ -28,7 +28,7 @@ namespace std unexpected_handler get_unexpected() _NOEXCEPT { - return __sync_fetch_and_add(&__cxxabiapple::__cxa_unexpected_handler, (unexpected_handler)0); + return __cxxabiapple::__cxa_unexpected_handler; } __attribute__((visibility("hidden"), noreturn)) @@ -50,7 +50,7 @@ unexpected() terminate_handler get_terminate() _NOEXCEPT { - return __sync_fetch_and_add(&__cxxabiapple::__cxa_terminate_handler, (terminate_handler)0); + return __cxxabiapple::__cxa_terminate_handler; } __attribute__((visibility("hidden"), noreturn)) @@ -101,13 +101,13 @@ terminate() _NOEXCEPT new_handler set_new_handler(new_handler handler) _NOEXCEPT { - return __sync_lock_test_and_set(&__cxxabiapple::__cxa_new_handler, handler); + return __sync_swap(&__cxxabiapple::__cxa_new_handler, handler); } new_handler get_new_handler() _NOEXCEPT { - return __sync_fetch_and_add(&__cxxabiapple::__cxa_new_handler, (new_handler)0); + return __cxxabiapple::__cxa_new_handler; } } // std |

