ITAMutex.cpp 279 Bytes
Newer Older
Jonas Stienen's avatar
Jonas Stienen committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#include "ITAMutex.h"

#include "ITAException.h"

ITAMutex::ITAMutex() {
	if (FAILED(hMutex = CreateMutex(NULL, FALSE, NULL)))
		ITA_EXCEPT1(UNKNOWN, "Mutex konnte nicht erzeugt werden");
}

ITAMutex::~ITAMutex() {
	WaitForSingleObject(hMutex, INFINITE);
	CloseHandle(hMutex);
}