wine-staging/patches/vcomp-Functions/0004-vcomp-Implement-OpenMP-nested-locking-functions.patch

118 lines
3.9 KiB
Diff

From 3f0b8509cf0b7c720b853046f391c6f3f0b9ed94 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 11 Aug 2015 06:06:39 +0200
Subject: vcomp: Implement OpenMP nested locking functions.
---
dlls/vcomp/main.c | 18 ++++++++++++++++++
dlls/vcomp/vcomp.spec | 6 +++---
dlls/vcomp100/vcomp100.spec | 6 +++---
dlls/vcomp110/vcomp110.spec | 6 +++---
dlls/vcomp90/vcomp90.spec | 6 +++---
5 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c
index 0a5e709..a110c11 100644
--- a/dlls/vcomp/main.c
+++ b/dlls/vcomp/main.c
@@ -1022,6 +1022,24 @@ void CDECL omp_destroy_lock(omp_lock_t *lock)
destroy_critsect(*lock);
}
+void CDECL omp_set_nest_lock(omp_nest_lock_t *lock)
+{
+ TRACE("(%p)\n", lock);
+ EnterCriticalSection(*lock);
+}
+
+void CDECL omp_unset_nest_lock(omp_nest_lock_t *lock)
+{
+ TRACE("(%p)\n", lock);
+ LeaveCriticalSection(*lock);
+}
+
+int CDECL omp_test_nest_lock(omp_nest_lock_t *lock)
+{
+ TRACE("(%p)\n", lock);
+ return TryEnterCriticalSection(*lock);
+}
+
void CDECL _vcomp_enter_critsect(CRITICAL_SECTION **critsect)
{
TRACE("(%p)\n", critsect);
diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec
index 418d176..4c89879 100644
--- a/dlls/vcomp/vcomp.spec
+++ b/dlls/vcomp/vcomp.spec
@@ -103,10 +103,10 @@
@ cdecl omp_init_nest_lock(ptr) omp_init_lock
@ cdecl omp_set_dynamic(long)
@ stub omp_set_lock
-@ stub omp_set_nest_lock
+@ cdecl omp_set_nest_lock(ptr)
@ cdecl omp_set_nested(long)
@ cdecl omp_set_num_threads(long)
@ stub omp_test_lock
-@ stub omp_test_nest_lock
+@ cdecl omp_test_nest_lock(ptr)
@ stub omp_unset_lock
-@ stub omp_unset_nest_lock
+@ cdecl omp_unset_nest_lock(ptr)
diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec
index 8a26b15..9021b10 100644
--- a/dlls/vcomp100/vcomp100.spec
+++ b/dlls/vcomp100/vcomp100.spec
@@ -103,10 +103,10 @@
@ cdecl omp_init_nest_lock(ptr) vcomp.omp_init_nest_lock
@ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
@ stub omp_set_lock
-@ stub omp_set_nest_lock
+@ cdecl omp_set_nest_lock(ptr) vcomp.omp_set_nest_lock
@ cdecl omp_set_nested(long) vcomp.omp_set_nested
@ cdecl omp_set_num_threads(long) vcomp.omp_set_num_threads
@ stub omp_test_lock
-@ stub omp_test_nest_lock
+@ cdecl omp_test_nest_lock(ptr) vcomp.omp_test_nest_lock
@ stub omp_unset_lock
-@ stub omp_unset_nest_lock
+@ cdecl omp_unset_nest_lock(ptr) vcomp.omp_unset_nest_lock
diff --git a/dlls/vcomp110/vcomp110.spec b/dlls/vcomp110/vcomp110.spec
index 64a4016..4f7503f 100644
--- a/dlls/vcomp110/vcomp110.spec
+++ b/dlls/vcomp110/vcomp110.spec
@@ -104,10 +104,10 @@
@ cdecl omp_init_nest_lock(ptr) vcomp.omp_init_nest_lock
@ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
@ stub omp_set_lock
-@ stub omp_set_nest_lock
+@ cdecl omp_set_nest_lock(ptr) vcomp.omp_set_nest_lock
@ cdecl omp_set_nested(long) vcomp.omp_set_nested
@ cdecl omp_set_num_threads(long) vcomp.omp_set_num_threads
@ stub omp_test_lock
-@ stub omp_test_nest_lock
+@ cdecl omp_test_nest_lock(ptr) vcomp.omp_test_nest_lock
@ stub omp_unset_lock
-@ stub omp_unset_nest_lock
+@ cdecl omp_unset_nest_lock(ptr) vcomp.omp_unset_nest_lock
diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec
index 8a26b15..9021b10 100644
--- a/dlls/vcomp90/vcomp90.spec
+++ b/dlls/vcomp90/vcomp90.spec
@@ -103,10 +103,10 @@
@ cdecl omp_init_nest_lock(ptr) vcomp.omp_init_nest_lock
@ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
@ stub omp_set_lock
-@ stub omp_set_nest_lock
+@ cdecl omp_set_nest_lock(ptr) vcomp.omp_set_nest_lock
@ cdecl omp_set_nested(long) vcomp.omp_set_nested
@ cdecl omp_set_num_threads(long) vcomp.omp_set_num_threads
@ stub omp_test_lock
-@ stub omp_test_nest_lock
+@ cdecl omp_test_nest_lock(ptr) vcomp.omp_test_nest_lock
@ stub omp_unset_lock
-@ stub omp_unset_nest_lock
+@ cdecl omp_unset_nest_lock(ptr) vcomp.omp_unset_nest_lock
--
2.5.0