]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Prefer getpid() over a direct syscall. Was there a reason for this?
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 28 Sep 2012 14:51:59 +0000 (14:51 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 28 Sep 2012 14:51:59 +0000 (14:51 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26840 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/thread_management.cc

index 2400d2765d267940bb429a004b8407e8e3e263d8..babab8defc09d36deedc285b0494fa0c42453aad 100644 (file)
@@ -148,10 +148,10 @@ namespace Threads
 
   unsigned int this_thread_id ()
   {
-#ifdef SYS_gettid
-    const int this_id = syscall(SYS_gettid);
-#elif HAVE_GETPID
+#if HAVE_GETPID
     const pid_t this_id = getpid();
+#elif SYS_gettid
+    const int this_id = syscall(SYS_gettid);
 #else
 #  ifdef DEAL_II_MSVC
     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.