Browse Source

Remove SetThreadDescription call on windows.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
6986801ddd
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/system.cpp

+ 3
- 3
src/system.cpp View File

@@ -11,7 +11,6 @@
#if defined ARCH_WIN #if defined ARCH_WIN
#include <windows.h> #include <windows.h>
#include <shellapi.h> #include <shellapi.h>
#include <processthreadsapi.h>
#endif #endif




@@ -93,18 +92,19 @@ void setThreadName(const std::string &name) {
#if defined ARCH_LIN || defined ARCH_MAC #if defined ARCH_LIN || defined ARCH_MAC
pthread_setname_np(pthread_self(), name.c_str()); pthread_setname_np(pthread_self(), name.c_str());
#elif defined ARCH_WIN #elif defined ARCH_WIN
SetThreadDescription(GetCurrentThread(), name.c_str());
// Unsupported on Windows
#endif #endif
} }


void setThreadRealTime() { void setThreadRealTime() {
#if defined ARCH_LIN || defined ARCH_MAC #if defined ARCH_LIN || defined ARCH_MAC
// Round-robin scheduler policy
int policy = SCHED_RR; int policy = SCHED_RR;
struct sched_param param; struct sched_param param;
param.sched_priority = sched_get_priority_max(policy); param.sched_priority = sched_get_priority_max(policy);
pthread_setschedparam(pthread_self(), policy, &param); pthread_setschedparam(pthread_self(), policy, &param);
#elif defined ARCH_WIN #elif defined ARCH_WIN
// Set entire process as realtime
// Set process class first
SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
#endif #endif


Loading…
Cancel
Save