Skip to content

Commit

Permalink
[Win32] Initialize COM library on queue threads
Browse files Browse the repository at this point in the history
  • Loading branch information
triplef committed Sep 10, 2023
1 parent 9566a13 commit be275d4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -6264,8 +6264,13 @@ _dispatch_worker_thread(void *context)
static unsigned WINAPI
_dispatch_worker_thread_thunk(LPVOID lpParameter)
{
_dispatch_worker_thread(lpParameter);
return 0;
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE);
if (FAILED(hr)) {
_dispatch_client_assert_fail("Error %ld initializing Windows Runtime", hr);
}
_dispatch_worker_thread(lpParameter);
CoUninitialize();
return 0;
}
#endif // defined(_WIN32)
#endif // DISPATCH_USE_PTHREAD_POOL
Expand Down

0 comments on commit be275d4

Please sign in to comment.