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

using namespace std;

#include "MeyersSingleton11.h"

MeyersSingleton11& MeyersSingleton11::Instance()
{
    static MeyersSingleton11 instance;
    return instance;
}

void MeyersSingleton11::Reset()
{
    lock_guard<mutex> mylock(mymutex);
    counter = 0;
}

void MeyersSingleton11::Increment()
{
    lock_guard<mutex> mylock(mymutex);
    counter++;
}

long long MeyersSingleton11::GetCounter()
{
    lock_guard<mutex> mylock(mymutex);
    return counter;
}

