<h3>Specific improvements</h3>
<ol>
+ <li>New: ThreadLocalStorage::clear() clears out all objects allocated on the
+ current and all other threads.
+ <br>
+ (Wolfgang Bangerth, 2014/02/06)
+
<li>Fixed: A configuration error on Debian Testing where accidentally a
non-pic libSuiteSparse_config.a was picked up when building a shared
library up resulting in a link error.
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2011 - 2013 by the deal.II authors
+// Copyright (C) 2011 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
/**
* Copy constructor. Initialize each thread local object
* with the corresponding object of the given object.
- **/
+ */
ThreadLocalStorage (const ThreadLocalStorage<T> &t);
/**
ThreadLocalStorage<T> &operator = (const T &t);
/**
- * Returns a reference to the internal implementation.
+ * Remove the thread-local objects stored for all threads that have
+ * created one with this object (i.e., that have called get()
+ * at least once on this thread. This includes the current thread. If you
+ * call get() subsequently on this or any other thread, new objects will
+ * again be created.
+ *
+ * If deal.II has been configured to not use multithreading, then this function
+ * does not do anything at all. Note that this of course has different semantics
+ * as in the multithreading context the objects are deleted and created again
+ * (possible by copying from a sample object, if the appropriate constructor
+ * of this class was called), whereas in the multithreaded context the object
+ * is simply not touched at all. At the same time, the purpose of this function
+ * is to release memory other threads may have allocated for their own thread
+ * local objects after which every use of this object will require some kind
+ * of initialization. This is necessary both in the multithreaded or
+ * non-multithreaded case.
+ */
+ void clear ();
+
+ /**
+ * Returns a reference to the internal Threading Building Blocks
+ * implementation. This function is really only useful if deal.II
+ * has been configured with multithreading and has no useful
+ * purpose otherwise.
*/
#ifdef DEAL_II_WITH_THREADS
tbb::enumerable_thread_specific<T> &
#else
T &
#endif
- get_implementation()
- {
- return data;
- }
+ get_implementation();
private:
#ifdef DEAL_II_WITH_THREADS
get() = t;
return *this;
}
+
+
+ template <typename T>
+ inline
+#ifdef DEAL_II_WITH_THREADS
+ tbb::enumerable_thread_specific<T> &
+#else
+ T &
+#endif
+ ThreadLocalStorage<T>::get_implementation()
+ {
+ return data;
+ }
+
+
+
+ template <typename T>
+ inline
+ void
+ ThreadLocalStorage<T>::clear ()
+ {
+#ifdef DEAL_II_WITH_THREADS
+ data.clear ();
+#endif
+ }
} // end of implementation of namespace Threads
/**