From 13eb6e1dbdd365d2383c0a3650a4d640c5ee0201 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 26 May 2020 20:43:43 -0500 Subject: [PATCH] update documentation --- include/deal.II/base/thread_local_storage.h | 27 +++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/include/deal.II/base/thread_local_storage.h b/include/deal.II/base/thread_local_storage.h index 5b3691ab3c..c2a0976fa8 100644 --- a/include/deal.II/base/thread_local_storage.h +++ b/include/deal.II/base/thread_local_storage.h @@ -104,13 +104,16 @@ namespace Threads ThreadLocalStorage(); /** - * A kind of copy constructor. Initialize each thread local object by - * copying the given object. + * A kind of copy constructor. Initializes an internal exemplar by the + * given object. The exemplar is in turn used to initialize each thread + * local object instead of invoking the default constructor. */ explicit ThreadLocalStorage(const T &t); /** - * FIXME + * A kind of move constructor. Moves the given object into an internal + * exemplar. The exemplar is in turn used to initialize each thread + * local object instead of invoking the default constructor. */ explicit ThreadLocalStorage(T &&t); @@ -121,7 +124,8 @@ namespace Threads ThreadLocalStorage(const ThreadLocalStorage &t) = default; /** - * Move constructor. FIXME + * Move constructor. Copies the internal state over from the given + * object. */ ThreadLocalStorage(ThreadLocalStorage &&t) = default; @@ -173,7 +177,17 @@ namespace Threads /** - * FIXME + * Move the given argument into the storage space used to represent the + * current thread. Calling this function as tls_data = + * object is equivalent to calling tls_data.get() = + * object. The intent of this operator is to make the + * ThreadLocalStorage object look more like the object it represents on + * the current thread. Move assignment operator. + * + * @param t The object to be copied into the storage space used for the + * current thread. + * + * @return The current object, after the changes have been made */ ThreadLocalStorage & operator=(T &&t); @@ -282,7 +296,6 @@ namespace Threads { // Take a unique ("writer") lock for manipulating the std::map. This // lock ensures that no other threat does a lookup at the same time. - // std::unique_lock lock(insertion_mutex); if constexpr (std::is_copy_constructible< @@ -295,7 +308,7 @@ namespace Threads if constexpr (std::is_default_constructible::value) { - return data[my_id]; // default construct + return data[my_id]; // invokes default constructor } Assert(false, ExcInternalError()); -- 2.39.5