Crypto++
|
#include <misc.h>
Public Member Functions | |
Singleton (F objectFactory=F()) | |
const T & | Ref (...) const |
This function safely initializes a static object in a multithreaded environment without using locks (for portability). Note that if two threads call Ref() at the same time, they may get back different references, and one object may end up being memory leaked. This is by design.