Files
NazaraEngine/src/Nazara/Core/Semaphore.cpp
Lynix ea8d683624 Updated copyright year
(532 files, wow)


Former-commit-id: cbb31f1124a86720bd3a54fe589a0f849a87b434
2015-01-21 20:53:01 +01:00

46 lines
858 B
C++

// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Semaphore.hpp>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Core/Win32/SemaphoreImpl.hpp>
#elif defined(NAZARA_PLATFORM_POSIX)
#include <Nazara/Core/Posix/SemaphoreImpl.hpp>
#else
#error Lack of implementation: Semaphore
#endif
#include <Nazara/Core/Debug.hpp>
NzSemaphore::NzSemaphore(unsigned int count)
{
m_impl = new NzSemaphoreImpl(count);
}
NzSemaphore::~NzSemaphore()
{
delete m_impl;
}
unsigned int NzSemaphore::GetCount() const
{
return m_impl->GetCount();
}
void NzSemaphore::Post()
{
m_impl->Post();
}
void NzSemaphore::Wait()
{
m_impl->Wait();
}
bool NzSemaphore::Wait(nzUInt32 timeout)
{
return m_impl->Wait(timeout);
}