From d1247612e663e403f07a60149220bb64ebf92590 Mon Sep 17 00:00:00 2001 From: Daniel R <47796739+polybiusproxy@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:36:38 +0300 Subject: [PATCH] kernel: Pthread rewrite touchups for Windows --- src/core/libraries/kernel/threads/pthread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/libraries/kernel/threads/pthread.cpp b/src/core/libraries/kernel/threads/pthread.cpp index 8b6207880..82e8dcd7f 100644 --- a/src/core/libraries/kernel/threads/pthread.cpp +++ b/src/core/libraries/kernel/threads/pthread.cpp @@ -286,7 +286,8 @@ int PS4_SYSV_ABI posix_pthread_create_name_np(PthreadT* thread, const PthreadAtt pthread_attr_init(&pattr); // pthread_attr_setstack(&pattr, new_thread->attr.stackaddr_attr, // new_thread->attr.stacksize_attr); - int ret = pthread_create(pthr, &pattr, (PthreadEntryFunc)RunThread, new_thread); + using WinPthreadEntry = void *(*)(void*); + int ret = pthread_create(pthr, &pattr, (WinPthreadEntry)RunThread, new_thread); ASSERT_MSG(ret == 0, "Failed to create thread with error {}", ret); if (ret) { *thread = nullptr; @@ -343,7 +344,7 @@ int PS4_SYSV_ABI posix_pthread_once(PthreadOnce* once_control, void (*init_routi } } - const auto once_cancel_handler = [](void* arg) { + const auto once_cancel_handler = [](void* arg) PS4_SYSV_ABI { PthreadOnce* once_control = (PthreadOnce*)arg; auto state = PthreadOnceState::InProgress; if (once_control->state.compare_exchange_strong(state, PthreadOnceState::NeverDone,