// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
#include <cstddef>

using namespace std;

#include "Lock.h"

#include "DoubleLockSingleton.h"

DoubleLockSingleton* DoubleLockSingleton::instance = NULL;

DoubleLockSingleton* DoubleLockSingleton::Instance()
{
    if(instance == NULL)
    {
        Lock mylock;
        if(instance == NULL)
        {
            instance = new DoubleLockSingleton();
        }
    }
    return instance;
}
