From 5d6b9d28f7c20697488d0decc326b771fe39b4da Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Wed, 25 Jan 2012 19:02:40 +0000 Subject: 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 --- libcxxabi/src/cxa_guard.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'libcxxabi/src/cxa_guard.cpp') 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 #include -#include -#include + +/* + 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 { -- cgit v1.2.3