| 91 | } |
| 92 | |
| 93 | void InitNet() |
| 94 | { |
| 95 | NetAdapter* na = GetNetAdapter(); |
| 96 | |
| 97 | if (!na) |
| 98 | { |
| 99 | Console.Error("DEV9: Failed to GetNetAdapter()"); |
| 100 | EmuConfig.DEV9.EthEnable = false; |
| 101 | return; |
| 102 | } |
| 103 | |
| 104 | nif = na; |
| 105 | RxRunning = true; |
| 106 | |
| 107 | rx_thread = std::thread(NetRxThread); |
| 108 | |
| 109 | #ifdef _WIN32 |
| 110 | SetThreadPriority(rx_thread.native_handle(), THREAD_PRIORITY_HIGHEST); |
| 111 | #elif defined(__POSIX__) |
| 112 | int policy = 0; |
| 113 | sched_param param; |
| 114 | |
| 115 | pthread_getschedparam(rx_thread.native_handle(), &policy, ¶m); |
| 116 | param.sched_priority = sched_get_priority_max(policy); |
| 117 | |
| 118 | pthread_setschedparam(rx_thread.native_handle(), policy, ¶m); |
| 119 | #endif |
| 120 | } |
| 121 | |
| 122 | void ReconfigureLiveNet(const Pcsx2Config& old_config) |
| 123 | { |
no test coverage detected