the whole game

This commit is contained in:
2026-03-02 22:04:18 +03:00
parent 816e9060b4
commit f0617a5d22
2069 changed files with 581500 additions and 0 deletions

40
src/raknet/LocklessTypes.h Executable file
View File

@@ -0,0 +1,40 @@
#ifndef __LOCKLESS_TYPES_H
#define __LOCKLESS_TYPES_H
#include "Export.h"
#include "NativeTypes.h"
#include "WindowsIncludes.h"
#if defined(ANDROID) || defined(__S3E__)
// __sync_fetch_and_add not supported apparently
#include "SimpleMutex.h"
#endif
namespace RakNet
{
class RAK_DLL_EXPORT LocklessUint32_t
{
public:
LocklessUint32_t();
explicit LocklessUint32_t(uint32_t initial);
// Returns variable value after changing it
uint32_t Increment(void);
// Returns variable value after changing it
uint32_t Decrement(void);
volatile uint32_t GetValue(void) const {return value;}
protected:
#ifdef _WIN32
volatile LONG value;
#elif defined(ANDROID) || defined(__S3E__)
// __sync_fetch_and_add not supported apparently
SimpleMutex mutex;
uint32_t value;
#else
volatile uint32_t value;
#endif
};
};
#endif