aboutsummaryrefslogtreecommitdiffstats
path: root/router/router.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-06-29 10:56:32 -0700
committerChris Robinson <[email protected]>2017-06-29 10:56:32 -0700
commit00694826ef5b2f410cdd9d8a2274b34ea86bffdf (patch)
tree35ec897340abc6a9f79950cf80cf9f4d55426c06 /router/router.c
parent058d57ef0352ee0f46fc5e0ebe76479660bfc44e (diff)
Protect context switches with a lock in the router
Diffstat (limited to 'router/router.c')
-rw-r--r--router/router.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/router/router.c b/router/router.c
index 4dfae314..f54643f4 100644
--- a/router/router.c
+++ b/router/router.c
@@ -16,6 +16,7 @@ int DriverListSize = 0;
static int DriverListSizeMax = 0;
almtx_t EnumerationLock;
+almtx_t ContextSwitchLock;
static void LoadDriverList(void);
@@ -29,6 +30,7 @@ BOOL APIENTRY DllMain(HINSTANCE UNUSED(module), DWORD reason, void* UNUSED(reser
case DLL_PROCESS_ATTACH:
LoadDriverList();
almtx_init(&EnumerationLock, almtx_recursive);
+ almtx_init(&ContextSwitchLock, almtx_plain);
break;
case DLL_THREAD_ATTACH:
@@ -37,6 +39,7 @@ BOOL APIENTRY DllMain(HINSTANCE UNUSED(module), DWORD reason, void* UNUSED(reser
case DLL_PROCESS_DETACH:
ReleaseALC();
+ almtx_destroy(&ContextSwitchLock);
almtx_destroy(&EnumerationLock);
for(i = 0;i < DriverListSize;i++)
{