[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: 8267819: CoInitialize/CoUninitialize should be called on same thread
From:       Alexander Matveev <almatvee () openjdk ! java ! net>
Date:       2021-05-28 4:56:05
Message-ID: ISTldYJ42ys-i_0DWPVcDY8LF87WSZ-eJ73ooADRcNE=.50776e56-359b-4e09-ab75-6e8d5d8b4082 () github ! com
[Download RAW message or body]

On Thu, 27 May 2021 04:18:24 GMT, Alexander Matveev <almatvee@openjdk.org> wrote:

> JDK-8264737 introduced new code for audio device removal/arrival notifications \
> which calls CoInitialize/CoUninitialize on separate threads. \
> CoInitialize/CoUninitialize should be called on same thread, since initialization \
> is per thread. Doing it on separate thread will result in unloading COM libraries \
> on that thread and if it uses COM libraries it might not work correctly. Fixed by \
> calling it on same thread in same way it is done in dshowwrapper.

1. Yes, I did test it on RDP reconnect for multiple streams.
2. Not really needed. CoCreateInstance() will fails in this case most likely and we \
will return false from Init(). So, it should be fine if it fails. Also, \
CoInitialize() can return RPC_E_CHANGED_MODE if someone already initialized thread as \
multithread apartment (MTA) and in this case CoCreateInstance() should work, so it is \
better not to fail Init() even if CoInitialize() failed.

-------------

PR: https://git.openjdk.java.net/jfx/pull/521


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic