diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-01-25 19:02:40 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-01-25 19:02:40 +0000 |
commit | 5d6b9d28f7c20697488d0decc326b771fe39b4da (patch) | |
tree | b9a39d8c13c5171b8fb035fb17917d1d4b01ed9c | |
parent | 0e496cddf0c762447e9fee19c2e809610878ccfb (diff) | |
download | bcm5719-llvm-5d6b9d28f7c20697488d0decc326b771fe39b4da.tar.gz bcm5719-llvm-5d6b9d28f7c20697488d0decc326b771fe39b4da.zip |
cxa_guard.cpp didn't quite make it on the last commit: Restricted headers to cxa_guard.cpp and abort_messsage.h, and added a comment regarding reentrancy brought up by John McCall. Thanks John.
llvm-svn: 148965
-rw-r--r-- | libcxxabi/src/cxa_guard.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libcxxabi/src/cxa_guard.cpp b/libcxxabi/src/cxa_guard.cpp index 742bac385be..814aaeb18f0 100644 --- a/libcxxabi/src/cxa_guard.cpp +++ b/libcxxabi/src/cxa_guard.cpp @@ -7,13 +7,20 @@ // //===----------------------------------------------------------------------===// -#include "cxxabi.h" #include "abort_message.h" #include <pthread.h> #include <stdint.h> -#include <stdio.h> -#include <stdlib.h> + +/* + This implementation must be careful to not call code external to this file + which will turn around and try to call __cxa_guard_acquire reentrantly. + For this reason, the headers of this file are as restricted as possible. + Previous implementations of this code for __APPLE__ have used + pthread_mutex_lock and the abort_message utility without problem. This + implementation also uses pthread_cond_wait which has tested to not be a + problem. +*/ namespace __cxxabiv1 { |