aboutsummaryrefslogtreecommitdiffstats
path: root/router/router.cpp
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.cpp
parenta0d03e50e849d6f295d618cc4bde115af596e68a (diff)
Use C++ atomics and mutexes in the router
Diffstat (limited to 'router/router.cpp')
-rw-r--r--router/router.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/router/router.cpp b/router/router.cpp
index 13cd3c69..95c0101d 100644
--- a/router/router.cpp
+++ b/router/router.cpp
@@ -18,7 +18,7 @@ DriverIface *DriverList = nullptr;
int DriverListSize = 0;
static int DriverListSizeMax = 0;
-altss_t ThreadCtxDriver;
+thread_local DriverIface *ThreadCtxDriver;
enum LogLevel LogLevel = LogLevel_Error;
FILE *LogFile;
@@ -59,19 +59,16 @@ BOOL APIENTRY DllMain(HINSTANCE UNUSED(module), DWORD reason, void* UNUSED(reser
TRACE("Initializing router v0.1-%s %s\n", ALSOFT_GIT_COMMIT_HASH, ALSOFT_GIT_BRANCH);
LoadDriverList();
- altss_create(&ThreadCtxDriver, nullptr);
InitALC();
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
- althrd_thread_detach();
break;
case DLL_PROCESS_DETACH:
ReleaseALC();
- altss_delete(ThreadCtxDriver);
for(i = 0;i < DriverListSize;i++)
{
@@ -87,7 +84,6 @@ BOOL APIENTRY DllMain(HINSTANCE UNUSED(module), DWORD reason, void* UNUSED(reser
fclose(LogFile);
LogFile = nullptr;
- althrd_deinit();
break;
}
return TRUE;