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
f7ffa590
Commit
f7ffa590
authored
May 18, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Use pthread_once for wine_vk_init.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43993a39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
vulkan.c
dlls/winemac.drv/vulkan.c
+5
-6
No files found.
dlls/winemac.drv/vulkan.c
View file @
f7ffa590
...
...
@@ -101,12 +101,12 @@ static inline struct wine_vk_surface *surface_from_handle(VkSurfaceKHR handle)
static
void
*
vulkan_handle
;
static
BOOL
WINAPI
wine_vk_init
(
INIT_ONCE
*
once
,
void
*
param
,
void
**
context
)
static
void
wine_vk_init
(
void
)
{
if
(
!
(
vulkan_handle
=
dlopen
(
SONAME_LIBMOLTENVK
,
RTLD_NOW
)))
{
ERR
(
"Failed to load %s
\n
"
,
SONAME_LIBMOLTENVK
);
return
TRUE
;
return
;
}
#define LOAD_FUNCPTR(f) if ((p##f = dlsym(vulkan_handle, #f)) == NULL) goto fail;
...
...
@@ -130,12 +130,11 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
LOAD_FUNCPTR
(
vkQueuePresentKHR
)
#undef LOAD_FUNCPTR
return
TRUE
;
return
;
fail:
dlclose
(
vulkan_handle
);
vulkan_handle
=
NULL
;
return
TRUE
;
}
/* Helper function for converting between win32 and MoltenVK compatible VkInstanceCreateInfo.
...
...
@@ -625,7 +624,7 @@ static void *macdrv_get_vk_instance_proc_addr(VkInstance instance, const char *n
static
const
struct
vulkan_funcs
*
get_vulkan_driver
(
UINT
version
)
{
static
INIT_ONCE
init_once
=
INIT_ONCE_STATIC
_INIT
;
static
pthread_once_t
init_once
=
PTHREAD_ONCE
_INIT
;
if
(
version
!=
WINE_VULKAN_DRIVER_VERSION
)
{
...
...
@@ -633,7 +632,7 @@ static const struct vulkan_funcs *get_vulkan_driver(UINT version)
return
NULL
;
}
InitOnceExecuteOnce
(
&
init_once
,
wine_vk_init
,
NULL
,
NULL
);
pthread_once
(
&
init_once
,
wine_vk_init
);
if
(
vulkan_handle
)
return
&
vulkan_funcs
;
...
...
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