File pdns-recursor-3.1.7_atomicity.patch of Package pdns-recursor
Index: recursor_cache.cc
===================================================================
--- recursor_cache.cc.orig 2006-11-12 17:56:13.000000000 +0100
+++ recursor_cache.cc 2007-02-27 21:44:27.347571093 +0100
@@ -9,9 +9,17 @@ using namespace std;
using namespace boost;
#include "config.h"
-
-#ifdef GCC_SKIP_LOCKING
+#if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) && defined(GCC_SKIP_LOCKING)
+#warning "using the optimized locking code on older gcc"
+#if HAVE_BITS_ATOMICITY_H
#include <bits/atomicity.h>
+#endif
+/*
+this is just a reminder. in gcc 4.2 it seems atomicity.h was moved under ext/
+#if HAVE_EXT_ATOMICITY_H
+#include <ext/atomicity.h>
+#endif
+*/
// This code is ugly but does speedup the recursor tremendously on multi-processor systems, and even has a large effect (20, 30%) on uniprocessor
namespace __gnu_cxx
{