mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
More work. Audio driver works enough to play music now.
This commit is contained in:
42
GpD3D/GpMutex_Win32.cpp
Normal file
42
GpD3D/GpMutex_Win32.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "GpMutex_Win32.h"
|
||||
|
||||
#include "GpWindows.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <new>
|
||||
|
||||
void GpMutex_Win32::Destroy()
|
||||
{
|
||||
this->~GpMutex_Win32();
|
||||
free(this);
|
||||
}
|
||||
|
||||
void GpMutex_Win32::Lock()
|
||||
{
|
||||
EnterCriticalSection(&m_critSection);
|
||||
}
|
||||
|
||||
void GpMutex_Win32::Unlock()
|
||||
{
|
||||
LeaveCriticalSection(&m_critSection);
|
||||
}
|
||||
|
||||
|
||||
GpMutex_Win32 *GpMutex_Win32::Create()
|
||||
{
|
||||
void *storage = malloc(sizeof(GpMutex_Win32));
|
||||
if (!storage)
|
||||
return nullptr;
|
||||
|
||||
return new (storage) GpMutex_Win32();
|
||||
}
|
||||
|
||||
GpMutex_Win32::GpMutex_Win32()
|
||||
{
|
||||
InitializeCriticalSection(&m_critSection);
|
||||
}
|
||||
|
||||
GpMutex_Win32::~GpMutex_Win32()
|
||||
{
|
||||
DeleteCriticalSection(&m_critSection);
|
||||
}
|
Reference in New Issue
Block a user