aboutsummaryrefslogtreecommitdiffstats
path: root/router/router.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-10-30 07:30:46 -0700
committerChris Robinson <[email protected]>2018-10-30 07:30:46 -0700
commite75e0a342ecb78a47bebe0b7f5124dfb83c56f32 (patch)
treede3139cef2abe1299f9b184f31e6b1ea52dadd98 /router/router.h
parenta0d03e50e849d6f295d618cc4bde115af596e68a (diff)
Use C++ atomics and mutexes in the router
Diffstat (limited to 'router/router.h')
-rw-r--r--router/router.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/router/router.h b/router/router.h
index 36c825d4..1a86da02 100644
--- a/router/router.h
+++ b/router/router.h
@@ -7,12 +7,12 @@
#include <stdio.h>
+#include <atomic>
+
#include "AL/alc.h"
#include "AL/al.h"
#include "AL/alext.h"
-#include "atomic.h"
#include "rwlock.h"
-#include "threads.h"
#ifdef __cplusplus
@@ -140,9 +140,8 @@ typedef struct DriverIface {
extern DriverIface *DriverList;
extern int DriverListSize;
-extern altss_t ThreadCtxDriver;
-typedef ATOMIC(DriverIface*) atomic_DriverIfacePtr;
-extern atomic_DriverIfacePtr CurrentCtxDriver;
+extern thread_local DriverIface *ThreadCtxDriver;
+extern std::atomic<DriverIface*> CurrentCtxDriver;
typedef struct PtrIntMap {
@@ -154,7 +153,7 @@ typedef struct PtrIntMap {
ALsizei capacity;
RWLock lock;
} PtrIntMap;
-#define PTRINTMAP_STATIC_INITIALIZE { NULL, NULL, 0, 0, RWLOCK_STATIC_INITIALIZE }
+#define PTRINTMAP_STATIC_INITIALIZE { nullptr, nullptr, 0, 0, RWLOCK_STATIC_INITIALIZE }
void InitPtrIntMap(PtrIntMap *map);
void ResetPtrIntMap(PtrIntMap *map);