Skip to content

Commit 52b65ed

Browse files
committed
[Win32] Initialize COM library on queue threads
1 parent 3e7c798 commit 52b65ed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/queue.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6264,8 +6264,12 @@ _dispatch_worker_thread(void *context)
62646264
static unsigned WINAPI
62656265
_dispatch_worker_thread_thunk(LPVOID lpParameter)
62666266
{
6267-
_dispatch_worker_thread(lpParameter);
6268-
return 0;
6267+
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE);
6268+
if (SUCCEEDED(hr)) {
6269+
_dispatch_worker_thread(lpParameter);
6270+
CoUninitialize();
6271+
}
6272+
return 0;
62696273
}
62706274
#endif // defined(_WIN32)
62716275
#endif // DISPATCH_USE_PTHREAD_POOL

0 commit comments

Comments
 (0)