Fixing controller input.

This commit is contained in:
Ben Vanik
2014-05-28 20:19:28 -07:00
parent c06526e5df
commit 18b1f9f513
2 changed files with 18 additions and 21 deletions

View File

@@ -86,22 +86,19 @@ void AudioSystem::ThreadStart() {
}
size_t pumped = 0;
{
SCOPE_profile_cpu_i("apu", "Pump");
if (result >= WAIT_OBJECT_0 && result <= WAIT_OBJECT_0 + (maximum_client_count_ - 1)) {
size_t index = result - WAIT_OBJECT_0;
do {
xe_mutex_lock(lock_);
uint32_t client_callback = clients_[index].callback;
uint32_t client_callback_arg = clients_[index].wrapped_callback_arg;
xe_mutex_unlock(lock_);
if (client_callback) {
processor->Execute(thread_state_, client_callback, client_callback_arg, 0);
}
pumped++;
index++;
} while (index < maximum_client_count_ && WaitForSingleObject(client_wait_handles_[index], 0) == WAIT_OBJECT_0);
}
if (result >= WAIT_OBJECT_0 && result <= WAIT_OBJECT_0 + (maximum_client_count_ - 1)) {
size_t index = result - WAIT_OBJECT_0;
do {
xe_mutex_lock(lock_);
uint32_t client_callback = clients_[index].callback;
uint32_t client_callback_arg = clients_[index].wrapped_callback_arg;
xe_mutex_unlock(lock_);
if (client_callback) {
processor->Execute(thread_state_, client_callback, client_callback_arg, 0);
}
pumped++;
index++;
} while (index < maximum_client_count_ && WaitForSingleObject(client_wait_handles_[index], 0) == WAIT_OBJECT_0);
}
if (!running_) {