Remove mutex class and use std
This commit is contained in:
parent
69cdf43909
commit
f146ddd307
5 changed files with 5 additions and 22 deletions
|
|
@ -27,7 +27,7 @@ ualni HeapAllocGlobal::getNAllocations() { return 0; }
|
||||||
|
|
||||||
tp::MemHead* tp::HeapAllocGlobal::mEntry = nullptr;
|
tp::MemHead* tp::HeapAllocGlobal::mEntry = nullptr;
|
||||||
tp::ualni tp::HeapAllocGlobal::mNumAllocations = 0;
|
tp::ualni tp::HeapAllocGlobal::mNumAllocations = 0;
|
||||||
tp::Mutex tp::HeapAllocGlobal::mMutex;
|
std::mutex tp::HeapAllocGlobal::mMutex;
|
||||||
bool tp::HeapAllocGlobal::mIgnore = true;
|
bool tp::HeapAllocGlobal::mIgnore = true;
|
||||||
|
|
||||||
// ----------------------- Debug Implementation ---------------------------- //
|
// ----------------------- Debug Implementation ---------------------------- //
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Module.hpp"
|
#include "Module.hpp"
|
||||||
#include "Multithreading.hpp"
|
#include <mutex>
|
||||||
|
|
||||||
namespace tp {
|
namespace tp {
|
||||||
|
|
||||||
|
|
@ -10,7 +10,7 @@ namespace tp {
|
||||||
#ifdef MEM_DEBUG
|
#ifdef MEM_DEBUG
|
||||||
static ualni mNumAllocations;
|
static ualni mNumAllocations;
|
||||||
static struct MemHead* mEntry;
|
static struct MemHead* mEntry;
|
||||||
static Mutex mMutex;
|
static std::mutex mMutex;
|
||||||
static bool mIgnore;
|
static bool mIgnore;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
option(MODULES_MEMORY_DEBUG "Debug memory" OFF)
|
option(MODULES_MEMORY_DEBUG "Debug memory" ON)
|
||||||
|
|
||||||
if (MODULES_MEMORY_DEBUG)
|
if (MODULES_MEMORY_DEBUG)
|
||||||
add_compile_definitions(MEM_DEBUG)
|
add_compile_definitions(MEM_DEBUG)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#include "Player.hpp"
|
#include "Player.hpp"
|
||||||
#include "Buffer.hpp"
|
#include "Buffer.hpp"
|
||||||
#include "Multithreading.hpp"
|
|
||||||
|
|
||||||
#include "portaudio.h"
|
#include "portaudio.h"
|
||||||
|
|
||||||
|
|
@ -125,7 +124,7 @@ private:
|
||||||
private:
|
private:
|
||||||
bool mInitializationStatus = false;
|
bool mInitializationStatus = false;
|
||||||
PaStream* mPaStream = nullptr;
|
PaStream* mPaStream = nullptr;
|
||||||
tp::Mutex mMutex;
|
std::mutex mMutex;
|
||||||
|
|
||||||
const tp::halnf* mBuffer = nullptr;
|
const tp::halnf* mBuffer = nullptr;
|
||||||
const tp::ualni* mPointerMax = nullptr;
|
const tp::ualni* mPointerMax = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <mutex>
|
|
||||||
|
|
||||||
namespace tp {
|
|
||||||
class Mutex {
|
|
||||||
std::mutex mMutex;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Mutex() = default;
|
|
||||||
|
|
||||||
void lock() { mMutex.lock(); }
|
|
||||||
|
|
||||||
void unlock() { mMutex.unlock(); }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue