]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: Use gettid for getting the thread number
authorMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 9 Oct 2012 13:25:39 +0000 (13:25 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 9 Oct 2012 13:25:39 +0000 (13:25 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@27028 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/thread_management.cc

index fed96e0a6c6f014128f4985bbe186e46fd2da0c8..501274ebee6e1fe0009724d530c8a2cde3726852 100644 (file)
@@ -134,7 +134,9 @@ namespace Threads
 
   unsigned int this_thread_id ()
   {
-#ifdef HAVE_GETPID
+#ifdef SYS_gettid
+    const pid_t this_id = syscall(SYS_gettid);
+#elif defined(HAVE_GETPID)
     const pid_t this_id = getpid();
 #else
     const unsigned int this_id = 0;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.