Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
504213c9
Commit
504213c9
authored
Apr 13, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Use pthread_rwlock_t in VkInstance_T.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a27d5bae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
Makefile.in
dlls/winevulkan/Makefile.in
+1
-0
vulkan.c
dlls/winevulkan/vulkan.c
+8
-7
vulkan_private.h
dlls/winevulkan/vulkan_private.h
+3
-1
No files found.
dlls/winevulkan/Makefile.in
View file @
504213c9
MODULE
=
winevulkan.dll
IMPORTLIB
=
winevulkan
IMPORTS
=
user32 gdi32 advapi32 setupapi
EXTRALIBS
=
$(PTHREAD_LIBS)
C_SRCS
=
\
vulkan.c
\
...
...
dlls/winevulkan/vulkan.c
View file @
504213c9
...
...
@@ -91,9 +91,9 @@ static void wine_vk_add_handle_mapping(struct VkInstance_T *instance, uint64_t
{
mapping
->
native_handle
=
native_handle
;
mapping
->
wine_wrapped_handle
=
wrapped_handle
;
AcquireSRWLockExclusive
(
&
instance
->
wrapper_lock
);
pthread_rwlock_wrlock
(
&
instance
->
wrapper_lock
);
list_add_tail
(
&
instance
->
wrappers
,
&
mapping
->
link
);
ReleaseSRWLockExclusive
(
&
instance
->
wrapper_lock
);
pthread_rwlock_unlock
(
&
instance
->
wrapper_lock
);
}
}
...
...
@@ -103,9 +103,9 @@ static void wine_vk_remove_handle_mapping(struct VkInstance_T *instance, struct
{
if
(
instance
->
enable_wrapper_list
)
{
AcquireSRWLockExclusive
(
&
instance
->
wrapper_lock
);
pthread_rwlock_wrlock
(
&
instance
->
wrapper_lock
);
list_remove
(
&
mapping
->
link
);
ReleaseSRWLockExclusive
(
&
instance
->
wrapper_lock
);
pthread_rwlock_unlock
(
&
instance
->
wrapper_lock
);
}
}
...
...
@@ -114,7 +114,7 @@ static uint64_t wine_vk_get_wrapper(struct VkInstance_T *instance, uint64_t nati
struct
wine_vk_mapping
*
mapping
;
uint64_t
result
=
0
;
AcquireSRWLockShared
(
&
instance
->
wrapper_lock
);
pthread_rwlock_rdlock
(
&
instance
->
wrapper_lock
);
LIST_FOR_EACH_ENTRY
(
mapping
,
&
instance
->
wrappers
,
struct
wine_vk_mapping
,
link
)
{
if
(
mapping
->
native_handle
==
native_handle
)
...
...
@@ -123,7 +123,7 @@ static uint64_t wine_vk_get_wrapper(struct VkInstance_T *instance, uint64_t nati
break
;
}
}
ReleaseSRWLockShared
(
&
instance
->
wrapper_lock
);
pthread_rwlock_unlock
(
&
instance
->
wrapper_lock
);
return
result
;
}
...
...
@@ -666,6 +666,7 @@ static void wine_vk_instance_free(struct VkInstance_T *instance)
WINE_VK_REMOVE_HANDLE_MAPPING
(
instance
,
instance
);
}
pthread_rwlock_destroy
(
&
instance
->
wrapper_lock
);
free
(
instance
->
utils_messengers
);
free
(
instance
);
...
...
@@ -882,7 +883,7 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info,
}
object
->
base
.
loader_magic
=
VULKAN_ICD_MAGIC_VALUE
;
list_init
(
&
object
->
wrappers
);
InitializeSRWLock
(
&
object
->
wrapper_lock
);
pthread_rwlock_init
(
&
object
->
wrapper_lock
,
NULL
);
res
=
wine_vk_instance_convert_create_info
(
create_info
,
&
create_info_host
,
object
);
if
(
res
!=
VK_SUCCESS
)
...
...
dlls/winevulkan/vulkan_private.h
View file @
504213c9
...
...
@@ -25,6 +25,8 @@
#define USE_STRUCT_CONVERSION
#endif
#include <pthread.h>
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
...
...
@@ -123,7 +125,7 @@ struct VkInstance_T
VkBool32
enable_wrapper_list
;
struct
list
wrappers
;
SRWLOCK
wrapper_lock
;
pthread_rwlock_t
wrapper_lock
;
struct
wine_debug_utils_messenger
*
utils_messengers
;
uint32_t
utils_messenger_count
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment