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
This commit is contained in:
Howard Hinnant 2012-01-25 19:02:40 +00:00
parent 0e496cddf0
commit 5d6b9d28f7
1 changed files with 10 additions and 3 deletions

View File

@ -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
{