remove global_define.h and adjust platform header includes

- Remove unused MRMutex
- Remove unused generate_key
This commit is contained in:
brainiac
2025-12-18 00:40:06 -08:00
committed by Alex
parent b95016c92f
commit c191ec02d4
59 changed files with 37 additions and 330 deletions
+3 -34
View File
@@ -19,14 +19,8 @@
#pragma once
#include "common/types.h"
#ifdef _WINDOWS
#include <winsock2.h>
#include <windows.h>
#else
#include "common/unix.h"
#include <pthread.h>
#endif
#include "common/platform/posix/include_pthreads.h"
#include "common/platform/win/include_windows.h"
class Mutex {
public:
@@ -38,7 +32,7 @@ public:
bool trylock();
protected:
private:
#if defined WIN32 || defined WIN64
#if defined _WINDOWS
CRITICAL_SECTION CSMutex;
#else
pthread_mutex_t CSMutex;
@@ -55,28 +49,3 @@ private:
bool locked;
Mutex* mut;
};
// Somewhat untested...
// Multi-read, single write mutex -Quagmire
class MRMutex {
public:
MRMutex();
~MRMutex();
void ReadLock();
bool TryReadLock();
void UnReadLock();
void WriteLock();
bool TryWriteLock();
void UnWriteLock();
int32 ReadLockCount();
int32 WriteLockCount();
private:
int32 rl; // read locks in effect
int32 wr; // write lock requests pending
int32 wl; // write locks in effect (should never be more than 1)
Mutex MCounters;
};