https://bugs.winehq.org/show_bug.cgi?id=41107
--- Comment #21 from Gabriel Ivăncescu gabrielopcode@gmail.com --- Created attachment 62786 --> https://bugs.winehq.org/attachment.cgi?id=62786 server: Do not signal violently terminated threads until they are really gone
Here's a fix as suggested by Sebastian: only wait if the thread was terminated violently, since that's when the risk of race condition exists (the thread is executing arbitrary code).
I sent it to wine-devel but I guess it's not going to get accepted so easily. At the very least, it should be updated in wine-staging, so this bug can be squashed.