Commit e51e7780 authored by Phil Willoughby's avatar Phil Willoughby Committed by Facebook Github Bot

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
parent a1d62691
......@@ -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<T> 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 <typename T, typename Tag = detail::DefaultTag>
class SingletonThreadLocal {
public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment