[PATCH v2 1/6] dinput: Simplify the internal thread and don't require loader lock.

Rémi Bernon rbernon at codeweavers.com
Mon Jan 3 02:59:34 CST 2022


On 1/3/22 01:14, Fabian Maurer wrote:
> This leads to a regression, see https://bugs.winehq.org/show_bug.cgi?id=52314
> 
> Not sure how that ever worked, since AFAIK shutting down the thread inside dll
> detach should always cause a deadlock.
> 
> On Freitag, 10. Dezember 2021 09:44:44 CET Rémi Bernon wrote:
>> When thread shuts down, instead of holding and releasing a module ref.
>>
>> This keeps the thread alive until the module is unloaded, instead of
>> keeping track of live IDirectInput instances.
>>
>> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
>> ---
> 

Yes, I intended to send some patches to fix it. It works in most cases 
when the DLL is unloaded on process shutdown (where LdrShutdownThread 
does nothing), but not when the DLL is manually unloaded.

As we're doing the same thing in XInput, it may cause the same thing 
there, although I haven't seen any report about it yet.

However, it'll be much more difficult to fix it here as there's no 
device creation / acquire mechanism, and no way to tell exactly when the 
thread can safely exit.

-- 
Rémi Bernon <rbernon at codeweavers.com>



More information about the wine-devel mailing list