Routing messages to debug targets.

This commit is contained in:
Ben Vanik
2013-12-22 00:51:50 -08:00
parent 88c8220951
commit a631ada0f7
7 changed files with 107 additions and 12 deletions

View File

@@ -106,6 +106,25 @@ void DebugServer::Shutdown() {
xe_mutex_unlock(lock_);
}
void DebugServer::AddTarget(const char* name, DebugTarget* target) {
xe_mutex_lock(lock_);
targets_[name] = target;
xe_mutex_unlock(lock_);
}
void DebugServer::RemoveTarget(const char* name) {
xe_mutex_lock(lock_);
targets_[name] = NULL;
xe_mutex_unlock(lock_);
}
DebugTarget* DebugServer::GetTarget(const char* name) {
xe_mutex_lock(lock_);
DebugTarget* target = targets_[name];
xe_mutex_unlock(lock_);
return target;
}
int DebugServer::WaitForClient() {
while (!has_clients()) {
WaitForSingleObject(client_event_, INFINITE);