Use CoreTiming for MemoryWatcher.

This commit is contained in:
spxtr
2016-04-28 21:28:15 -07:00
parent aebff2c161
commit b9e9a5ee3d
3 changed files with 55 additions and 39 deletions

View File

@ -4,9 +4,7 @@
#pragma once
#include <atomic>
#include <map>
#include <thread>
#include <vector>
#include <sys/socket.h>
#include <sys/un.h>
@ -24,6 +22,10 @@ class MemoryWatcher final
public:
MemoryWatcher();
~MemoryWatcher();
void Step();
static void Init();
static void Shutdown();
private:
bool LoadAddresses(const std::string& path);
@ -33,10 +35,7 @@ private:
u32 ChasePointer(const std::string& line);
std::string ComposeMessage(const std::string& line, u32 value);
void WatcherThread();
std::thread m_watcher_thread;
std::atomic_bool m_running{false};
bool m_running;
int m_fd;
sockaddr_un m_addr;