[PATCH, v3] inline std::this_thread::get_id

Chris Fairles chris.fairles@gmail.com
Mon Feb 9 05:28:00 GMT 2009


Inline std::this_thread::get_id to satisfy ODR when included in multiple TU's.

tested x86_64, ok for trunk?

Chris
-------------- next part --------------
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 144023)
+++ ChangeLog	(working copy)
@@ -1,5 +1,9 @@
 2009-02-08  Chris Fairles  <cfairles@gcc.gnu.org>
 
+	* include/std/thread (this_thread::get_id): Inline.
+
+2009-02-08  Chris Fairles  <cfairles@gcc.gnu.org>
+
 	* include/std/thread (thread<>::thread(_Callable)): Explicitly use
 	_Callable as template argument for _M_make_shared_data.
 	* testsuite/30_threads/thread/cons/6.cc: New.
Index: include/std/thread
===================================================================
--- include/std/thread	(revision 144023)
+++ include/std/thread	(working copy)
@@ -239,7 +239,7 @@
   // 30.2.2 Namespace this_thread.
   namespace this_thread
   {
-    thread::id
+    inline thread::id
     get_id() { return thread::id(__gthread_self()); }
 
 #ifdef _GLIBCXX_USE_SCHED_YIELD


More information about the Gcc-patches mailing list