Daniel Lehman : msvcp140_atomic_wait: Implement __std_submit_threadpool_work.

Alexandre Julliard julliard at winehq.org
Fri Jan 28 14:29:33 CST 2022


Module: wine
Branch: master
Commit: 68ad71a072d355bf8b4caec996e84a4fbd277059
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=68ad71a072d355bf8b4caec996e84a4fbd277059

Author: Daniel Lehman <dlehman at esri.com>
Date:   Fri Jan 28 16:18:58 2022 +0100

msvcp140_atomic_wait: Implement __std_submit_threadpool_work.

Signed-off-by: Daniel Lehman <dlehman at esri.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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);




More information about the wine-cvs mailing list