From 68ad71a072d355bf8b4caec996e84a4fbd277059 Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Fri, 28 Jan 2022 16:18:58 +0100 Subject: [PATCH] msvcp140_atomic_wait: Implement __std_submit_threadpool_work. Signed-off-by: Daniel Lehman Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcp140_atomic_wait/main.c | 6 ++++++ dlls/msvcp140_atomic_wait/msvcp140_atomic_wait.spec | 2 +- dlls/msvcp140_atomic_wait/tests/msvcp140_atomic_wait.c | 7 +++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/msvcp140_atomic_wait/main.c b/dlls/msvcp140_atomic_wait/main.c index bdc46412771..1f5440b248a 100644 --- a/dlls/msvcp140_atomic_wait/main.c +++ b/dlls/msvcp140_atomic_wait/main.c @@ -37,3 +37,9 @@ PTP_WORK __stdcall __std_create_threadpool_work(PTP_WORK_CALLBACK callback, void TRACE("(%p %p %p)\n", callback, context, environ); return CreateThreadpoolWork(callback, context, environ); } + +void __stdcall __std_submit_threadpool_work(PTP_WORK work) +{ + TRACE("(%p)\n", work); + return SubmitThreadpoolWork(work); +} diff --git a/dlls/msvcp140_atomic_wait/msvcp140_atomic_wait.spec b/dlls/msvcp140_atomic_wait/msvcp140_atomic_wait.spec index 3b4fd48dc7f..d5c9b45a119 100644 --- a/dlls/msvcp140_atomic_wait/msvcp140_atomic_wait.spec +++ b/dlls/msvcp140_atomic_wait/msvcp140_atomic_wait.spec @@ -20,7 +20,7 @@ @ stub __std_free_crt @ stdcall __std_parallel_algorithms_hw_threads() @ stub __std_release_shared_mutex_for_instance -@ stub __std_submit_threadpool_work +@ stdcall __std_submit_threadpool_work(ptr) @ stub __std_tzdb_delete_current_zone @ stub __std_tzdb_delete_leap_seconds @ stub __std_tzdb_delete_sys_info diff --git a/dlls/msvcp140_atomic_wait/tests/msvcp140_atomic_wait.c b/dlls/msvcp140_atomic_wait/tests/msvcp140_atomic_wait.c index 097a81e5029..0e707e9be44 100644 --- a/dlls/msvcp140_atomic_wait/tests/msvcp140_atomic_wait.c +++ b/dlls/msvcp140_atomic_wait/tests/msvcp140_atomic_wait.c @@ -25,6 +25,7 @@ static unsigned int (__stdcall *p___std_parallel_algorithms_hw_threads)(void); static PTP_WORK (__stdcall *p___std_create_threadpool_work)(PTP_WORK_CALLBACK, void*, PTP_CALLBACK_ENVIRON); +static void (__stdcall *p___std_submit_threadpool_work)(PTP_WORK); #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) @@ -38,6 +39,7 @@ static HMODULE init(void) SET(p___std_parallel_algorithms_hw_threads, "__std_parallel_algorithms_hw_threads"); SET(p___std_create_threadpool_work, "__std_create_threadpool_work"); + SET(p___std_submit_threadpool_work, "__std_submit_threadpool_work"); return msvcp; } @@ -81,13 +83,14 @@ static void test_threadpool_work(void) if (0) /* crash on windows */ { p___std_create_threadpool_work(NULL, NULL, NULL); + p___std_submit_threadpool_work(NULL); } /* simple test */ workcalled = 0; work = p___std_create_threadpool_work(threadpool_workcallback, &workcalled, NULL); ok(!!work, "failed to create threadpool_work\n"); - SubmitThreadpoolWork(work); + p___std_submit_threadpool_work(work); WaitForThreadpoolWorkCallbacks(work, FALSE); CloseThreadpoolWork(work); ok(workcalled == 1, "expected work to be called once, got %d\n", workcalled); @@ -102,7 +105,7 @@ static void test_threadpool_work(void) workcalled = 0; work = p___std_create_threadpool_work(threadpool_workcallback, &workcalled, &environment); ok(!!work, "failed to create threadpool_work\n"); - SubmitThreadpoolWork(work); + p___std_submit_threadpool_work(work); WaitForThreadpoolWorkCallbacks(work, FALSE); CloseThreadpoolWork(work); ret = WaitForSingleObject(cb_event, 1000);