Consistent use of anonymous namespace

Also change `bindThisThread` to match the current code style for function naming.

closes https://github.com/official-stockfish/Stockfish/pull/5118

No functional change
This commit is contained in:
Disservin
2024-03-17 10:33:03 +01:00
parent ed60460004
commit 134e6d7bb4
6 changed files with 45 additions and 36 deletions
+5 -3
View File
@@ -596,14 +596,15 @@ namespace WinProcGroup {
#ifndef _WIN32
void bindThisThread(size_t) {}
void bind_this_thread(size_t) {}
#else
namespace {
// Retrieves logical processor information using Windows-specific
// API and returns the best node id for the thread with index idx. Original
// code from Texel by Peter Österlund.
static int best_node(size_t idx) {
int best_node(size_t idx) {
int threads = 0;
int nodes = 0;
@@ -668,10 +669,11 @@ static int best_node(size_t idx) {
// then return -1 and let the OS to decide what to do.
return idx < groups.size() ? groups[idx] : -1;
}
}
// Sets the group affinity of the current thread
void bindThisThread(size_t idx) {
void bind_this_thread(size_t idx) {
// Use only local variables to be thread-safe
int node = best_node(idx);