From 568470a2efd6a4bc73a2709ebfaa401c0e1882d6 Mon Sep 17 00:00:00 2001 From: Yasser Nascimento Date: Wed, 4 Mar 2026 17:46:31 -0300 Subject: [PATCH] test: remove conditionals from `uv_thread_self` usage The Windows limitation was fixed in: https://github.com/libuv/libuv/pull/3357. --- test/test-thread-affinity.c | 5 ----- test/test-thread-name.c | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/test/test-thread-affinity.c b/test/test-thread-affinity.c index d21487d99..8d7e4ff2a 100644 --- a/test/test-thread-affinity.c +++ b/test/test-thread-affinity.c @@ -56,12 +56,7 @@ TEST_IMPL(thread_affinity) { int i; uv_thread_t threads[3]; -#ifdef _WIN32 - /* uv_thread_self isn't defined for the main thread on Windows */ - threads[0] = GetCurrentThread(); -#else threads[0] = uv_thread_self(); -#endif cpumasksize = uv_cpumask_size(); ASSERT_GT(cpumasksize, 0); diff --git a/test/test-thread-name.c b/test/test-thread-name.c index 393407442..f68656cec 100644 --- a/test/test-thread-name.c +++ b/test/test-thread-name.c @@ -38,12 +38,7 @@ static void thread_run(void* arg) { sem = arg; -#ifdef _WIN32 - /* uv_thread_self isn't defined for the main thread on Windows. */ - thread = GetCurrentThread(); -#else thread = uv_thread_self(); -#endif r = uv_thread_setname("worker-thread"); ASSERT_OK(r); @@ -82,12 +77,7 @@ TEST_IMPL(thread_name) { memset(long_thread_name, 'a', sizeof(long_thread_name) - 1); long_thread_name[sizeof(long_thread_name) - 1] = '\0'; -#ifdef _WIN32 - /* uv_thread_self isn't defined for the main thread on Windows. */ - threads[0] = GetCurrentThread(); -#else threads[0] = uv_thread_self(); -#endif r = uv_thread_getname(&threads[0], tn, sizeof(tn)); ASSERT_OK(r);