]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compiling with THREADS=OFF 7249/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 28 Sep 2018 21:13:12 +0000 (23:13 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 28 Sep 2018 21:14:05 +0000 (23:14 +0200)
include/deal.II/base/thread_management.h
source/base/thread_management.cc

index 32050b26683a7094ce4fd58d1985fe8343f9ed54..f07c62e24e0ef3db7ea8fc99a8dbb4c6ae16de0e 100644 (file)
 #  include <deal.II/base/multithread_info.h>
 #  include <deal.II/base/template_constraints.h>
 
-#  ifdef DEAL_II_WITH_THREADS
-#    include <condition_variable>
-#    include <mutex>
-#    include <thread>
-#  endif
-
+#  include <condition_variable>
 #  include <functional>
 #  include <iterator>
 #  include <list>
 #  include <memory>
+#  include <mutex>
 #  include <tuple>
 #  include <utility>
 #  include <vector>
-
-
 #  ifdef DEAL_II_WITH_THREADS
+#    include <thread>
 #    ifdef DEAL_II_USE_MT_POSIX
 #      include <pthread.h>
 #    endif
index cb504a524712ec6f4fab5ee25123efb4cfe00e0e..aeb92f3745811e688c6c65d2ac43287c16b94766 100644 (file)
@@ -148,19 +148,10 @@ namespace Threads
 
 
 
-#ifndef DEAL_II_WITH_THREADS
-  DummyBarrier::DummyBarrier(const unsigned int count, const char *, void *)
-  {
-    (void)count;
-    Assert(count == 1, ExcBarrierSizeNotUseful(count));
-  }
-
-
-#else
-#  ifdef DEAL_II_USE_MT_POSIX
+#ifdef DEAL_II_USE_MT_POSIX
 
 
-#    ifndef DEAL_II_USE_MT_POSIX_NO_BARRIERS
+#  ifndef DEAL_II_USE_MT_POSIX_NO_BARRIERS
   PosixThreadBarrier::PosixThreadBarrier(const unsigned int count,
                                          const char *,
                                          void *)
@@ -168,7 +159,7 @@ namespace Threads
     pthread_barrier_init(&barrier, nullptr, count);
   }
 
-#    else
+#  else
 
   PosixThreadBarrier::PosixThreadBarrier(const unsigned int count,
                                          const char *,
@@ -187,21 +178,21 @@ namespace Threads
                            "this class, but the rest of the threading\n"
                            "functionality is available."));
   }
-#    endif
+#  endif
 
 
 
   PosixThreadBarrier::~PosixThreadBarrier()
   {
-#    ifndef DEAL_II_USE_MT_POSIX_NO_BARRIERS
+#  ifndef DEAL_II_USE_MT_POSIX_NO_BARRIERS
     pthread_barrier_destroy(&barrier);
-#    else
+#  else
     // unless the barrier is a no-op,
     // complain again (how did we get
     // here then?)
     if (count != 1)
       std::abort();
-#    endif
+#  endif
   }
 
 
@@ -209,9 +200,9 @@ namespace Threads
   int
   PosixThreadBarrier::wait()
   {
-#    ifndef DEAL_II_USE_MT_POSIX_NO_BARRIERS
+#  ifndef DEAL_II_USE_MT_POSIX_NO_BARRIERS
     return pthread_barrier_wait(&barrier);
-#    else
+#  else
     // in the special case, this
     // function is a no-op. otherwise
     // complain about the missing
@@ -223,12 +214,11 @@ namespace Threads
         std::abort();
         return 1;
       };
-#    endif
+#  endif
   }
 
 
 
-#  endif
 #endif
 
 

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.