parent
79bcc7d6e1
commit
a36ba41eb4
@ -25,7 +25,7 @@ namespace
|
|||||||
std::unordered_map<ThreadParam, TextThread*> textThreadsByParams;
|
std::unordered_map<ThreadParam, TextThread*> textThreadsByParams;
|
||||||
std::unordered_map<DWORD, ProcessRecord> processRecordsByIds;
|
std::unordered_map<DWORD, ProcessRecord> processRecordsByIds;
|
||||||
|
|
||||||
WinMutex hostMutex;
|
std::recursive_mutex hostMutex;
|
||||||
|
|
||||||
DWORD DUMMY[100];
|
DWORD DUMMY[100];
|
||||||
ThreadParam CONSOLE{ 0, -1ULL, -1ULL, -1ULL };
|
ThreadParam CONSOLE{ 0, -1ULL, -1ULL, -1ULL };
|
||||||
|
@ -28,7 +28,7 @@ private:
|
|||||||
|
|
||||||
std::vector<char> buffer;
|
std::vector<char> buffer;
|
||||||
std::wstring storage;
|
std::wstring storage;
|
||||||
WinMutex ttMutex;
|
std::recursive_mutex ttMutex;
|
||||||
|
|
||||||
HANDLE deletionEvent = CreateEventW(nullptr, FALSE, FALSE, NULL);
|
HANDLE deletionEvent = CreateEventW(nullptr, FALSE, FALSE, NULL);
|
||||||
std::thread flushThread = std::thread([&]() { while (WaitForSingleObject(deletionEvent, 100) == WAIT_TIMEOUT) Flush(); });
|
std::thread flushThread = std::thread([&]() { while (WaitForSingleObject(deletionEvent, 100) == WAIT_TIMEOUT) Flush(); });
|
||||||
|
@ -68,15 +68,4 @@ struct HookRemovedNotif // From hook
|
|||||||
unsigned __int64 address;
|
unsigned __int64 address;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Artikash 8/28/2018: similar to std::recursive_mutex but uses WinAPI for better performance
|
typedef std::lock_guard<std::recursive_mutex> LOCK;
|
||||||
class WinMutex
|
|
||||||
{
|
|
||||||
CRITICAL_SECTION cs;
|
|
||||||
public:
|
|
||||||
WinMutex() { InitializeCriticalSection(&cs); };
|
|
||||||
~WinMutex() { EnterCriticalSection(&cs); LeaveCriticalSection(&cs); DeleteCriticalSection(&cs); };
|
|
||||||
void lock() { EnterCriticalSection(&cs); };
|
|
||||||
void unlock() { LeaveCriticalSection(&cs); };
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::lock_guard<WinMutex> LOCK;
|
|
||||||
|
Loading…
Reference in New Issue
Block a user