mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 04:56:20 +00:00
remove global_define.h and adjust platform header includes
- Remove unused MRMutex - Remove unused generate_key
This commit is contained in:
+3
-34
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user