drd manual: Fix C++11 instructions

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14004 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/docs/drd-manual.xml b/drd/docs/drd-manual.xml
index 0fb8b4b..4e5064a 100644
--- a/drd/docs/drd-manual.xml
+++ b/drd/docs/drd-manual.xml
@@ -1252,22 +1252,31 @@
 <sect2 id="drd-manual.C++11" xreflabel="C++11">
 <title>Debugging C++11 Programs</title>
 
-<para>If you want to use the C++11 class std::thread you will need to add the
-following code at the start of a common header or at the start of each source
-file to avoid that false positives are reported on the std::thread
-implementation:</para>
-
-<programlisting>
+<para>If you want to use the C++11 class std::thread you will need to do the
+  following to annotate the std::shared_ptr&lt;&gt; objects used in the
+  implementation of that class:
+<itemizedlist>
+  <listitem>
+    <para>Add the following code at the start of a common header or at the
+    start of each source file, before any C++ header files are included:</para>
+    <programlisting>
 #include &lt;valgrind/drd.h&gt;
 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(addr) ANNOTATE_HAPPENS_BEFORE(addr)
 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(addr)  ANNOTATE_HAPPENS_AFTER(addr)
-#define _GLIBCXX_EXTERN_TEMPLATE -1
 </programlisting>
-
-<para>This code must occur before any C++ header files are included. Since the
-implementation of std::thread uses the C++ shared pointer implementation, that
-shared pointer implementation has to be annotated in order to avoid false
-positives. The above code implements such annotation.  See also <emphasis>The
+  </listitem>
+  <listitem>
+    <para>Download the gcc source code and from source file
+    libstdc++-v3/src/c++11/thread.cc copy the implementation of the
+    <computeroutput>execute_native_thread_routine()</computeroutput>
+    and <computeroutput>std::thread::_M_start_thread()</computeroutput>
+    functions into a source file that is linked with your application. Make
+    sure that also in this source file the
+    _GLIBCXX_SYNCHRONIZATION_HAPPENS_*() macros are defined properly.</para>
+  </listitem>
+</itemizedlist>
+</para>
+<para>For more information, see also <emphasis>The
 GNU C++ Library Manual, Debugging Support</emphasis>
 (<ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug.html">http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug.html</ulink>)
 for more information.</para>