Lifecycle management of threads #29

Merged
harraiken merged 240 commits from threads into master 2026-09-07 13:45:09 +02:00
Showing only changes of commit ba6b22f160 - Show all commits

View File

@@ -28,8 +28,9 @@ OB::DeviceMap::GetGlobalDevicesDirectory(IN POBJECT_DIRECTORY Directory)
/* Assume no mapping exists */
GlobalDevicesDirectory = NULLPTR;
/* Acquire the device map lock */
KE::PushLock::AcquireExclusivePushLock(&DeviceMapLock);
/* Enter guarded region and acquire the device map lock */
KE::GuardedRegionGuard GuardedRegion;
KE::PushLockExclusiveGuard PushLock(&DeviceMapLock);
/* Check if the directory has an associated device map */
if(Directory->DeviceMap)
@@ -38,9 +39,6 @@ OB::DeviceMap::GetGlobalDevicesDirectory(IN POBJECT_DIRECTORY Directory)
GlobalDevicesDirectory = Directory->DeviceMap->GlobalDevicesDirectory;
}
/* Release the device map lock */
KE::PushLock::ReleaseExclusivePushLock(&DeviceMapLock);
/* Return the resolved directory */
return GlobalDevicesDirectory;
}