Setting process affinity to use all processors.

This commit is contained in:
Ben Vanik 2015-05-15 23:52:48 -07:00
parent 986534d448
commit cda0341c25
1 changed files with 7 additions and 0 deletions

View File

@ -63,6 +63,13 @@ Emulator::~Emulator() {
X_STATUS Emulator::Setup() {
X_STATUS result = X_STATUS_UNSUCCESSFUL;
HANDLE process_handle = GetCurrentProcess();
DWORD_PTR process_affinity_mask;
DWORD_PTR system_affinity_mask;
GetProcessAffinityMask(process_handle, &process_affinity_mask,
&system_affinity_mask);
SetProcessAffinityMask(process_handle, system_affinity_mask);
// Create the main window. Other parts will hook into this.
main_window_ = std::make_unique<ui::MainWindow>(this);
main_window_->Start();