From e51e77808a23b50ae1d61ec0a9ca2a5f89e4b9bb Mon Sep 17 00:00:00 2001 From: Phil Willoughby Date: Thu, 1 Jun 2017 08:43:35 -0700 Subject: [PATCH] Docs for SingletonThreadLocal Summary: Add a few keywords people search for when looking for this that won't otherwise find this file. Add a reference to the usage notes for Singleton which are a good description of how you should operate SingletoThreadLocal as well. Reviewed By: nbronson Differential Revision: D5094598 fbshipit-source-id: 9980850805e1564e5c394af713e2fa17fe8844fe --- folly/SingletonThreadLocal.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/folly/SingletonThreadLocal.h b/folly/SingletonThreadLocal.h index 943883b6..a4bb4627 100644 --- a/folly/SingletonThreadLocal.h +++ b/folly/SingletonThreadLocal.h @@ -21,6 +21,21 @@ namespace folly { +// SingletonThreadLocal +// +// This class can help you implement a per-thread leaky-singleton model within +// your application. Please read the usage block at the top of Singleton.h as +// the recommendations there are also generally applicable to this class. +// +// When we say this is "leaky" we mean that the T instances held by a +// SingletonThreadLocal will survive until their owning thread exits, +// regardless of the lifetime of the singleton object holding them. That +// means that they can be safely used during process shutdown, and +// that they can also be safely used in an application that spawns many +// temporary threads throughout its life. +// +// Keywords to help people find this class in search: +// Thread Local Singleton ThreadLocalSingleton template class SingletonThreadLocal { public: -- 2.34.1