Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Zarzycki <zarzycki@apple.com>2012-03-15 12:58:08 +0400
committerDave Zarzycki <zarzycki@apple.com>2012-03-15 12:58:08 +0400
commitd6533ccd48957d81a13399a48cf01f88e4840bb0 (patch)
treeb4c4034e74f3aa37263f6599594c888da0e265a4 /libcxxabi/src/cxa_handlers.cpp
parent13e35c086cc5988a8b5ab26f1ddfe9278783ae12 (diff)
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.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxxabi/src/cxa_handlers.cpp b/libcxxabi/src/cxa_handlers.cpp
index 1cfdfe7ae703..97f1347010e3 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