Browse Source

[chore] fix build errors

Signed-off-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
pintocputhing
Caio Oliveira 2 weeks ago
parent
commit
112b14b564
No known key found for this signature in database GPG Key ID: AAAE6C7FD4186B0C
  1. 6
      src/common/thread.cpp

6
src/common/thread.cpp

@ -6,8 +6,6 @@
#include <string> #include <string>
#include <thread> #include <thread>
#include <sys/_cpuset.h>
#include <sys/cpuset.h>
#include "common/error.h" #include "common/error.h"
#include "common/logging/log.h" #include "common/logging/log.h"
@ -22,6 +20,8 @@
#include "common/string_util.h" #include "common/string_util.h"
#else #else
#if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) #if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/cpuset.h>
#include <sys/_cpuset.h>
#include <pthread_np.h> #include <pthread_np.h>
#endif #endif
#include <pthread.h> #include <pthread.h>
@ -118,7 +118,7 @@ void SetCurrentThreadName(const char* name) {
} }
void PinCurrentThreadToPerformanceCore(size_t core_id) { void PinCurrentThreadToPerformanceCore(size_t core_id) {
ASSERT(core_id >= 0 && core_id < 4);
ASSERT(core_id < 4);
// If we set a flag for a CPU that doesn't exist, the thread may not be allowed to // If we set a flag for a CPU that doesn't exist, the thread may not be allowed to
// run in ANY processor! // run in ANY processor!
auto const total_cores = std::thread::hardware_concurrency(); auto const total_cores = std::thread::hardware_concurrency();

Loading…
Cancel
Save