mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d: Factor out vkd3d_join_thread().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
bc5e8a9cc2
commit
7ecd67aaa0
@@ -3112,7 +3112,6 @@ static HRESULT d3d12_device_init(struct d3d12_device *device,
|
||||
vkd3d_instance_incref(device->vkd3d_instance = instance);
|
||||
device->vk_info = instance->vk_info;
|
||||
device->signal_event = instance->signal_event;
|
||||
device->join_thread = instance->join_thread;
|
||||
device->wchar_size = instance->wchar_size;
|
||||
|
||||
device->adapter_luid = create_info->adapter_luid;
|
||||
@@ -3223,6 +3222,28 @@ HRESULT vkd3d_create_thread(struct vkd3d_instance *instance,
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_handle *thread)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
int rc;
|
||||
|
||||
if (instance->join_thread)
|
||||
{
|
||||
if (FAILED(hr = instance->join_thread(thread->handle)))
|
||||
ERR("Failed to join thread, hr %#x.\n", hr);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((rc = pthread_join(thread->pthread, NULL)))
|
||||
{
|
||||
ERR("Failed to join thread, error %d.\n", rc);
|
||||
hr = hresult_from_errno(rc);
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
IUnknown *vkd3d_get_device_parent(ID3D12Device *device)
|
||||
{
|
||||
struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device);
|
||||
|
||||
Reference in New Issue
Block a user