There is a global variable called "pTrackerArray", which is used in Loki's SetLongevity function.
Declaration of pTrackerArray:
typedef std::list<LifetimeTracker*> TrackerArray;
extern LOKI_EXPORT TrackerArray* pTrackerArray;
Definition of SetLongevity:
template <typename T, typename Destroyer>
void SetLongevity(T* pDynObject, unsigned int longevity, Destroyer d)
{
using namespace Private;
// manage lifetime of stack manually
if(pTrackerArray==0)
pTrackerArray = new TrackerArray;
// For simplicity, the rest of code is omitted
...
}
Is it thread safe to use pTrackerArray as such in SetLongevity?