Matteo Bruni (@Mystral) commented about dlls/d3dx10_43/d3dx10_43_main.c:
+ if (thread_pump->proc_count == THREAD_PUMP_EXITING) + { + ReleaseSRWLockExclusive(&thread_pump->proc_lock); + work_item_free(work_item, TRUE); + return 0; + } + + list_add_tail(&thread_pump->proc_queue, &work_item->entry); + thread_pump->proc_count++; + ReleaseSRWLockExclusive(&thread_pump->proc_lock); + RtlWakeAddressAll((void *)&thread_pump->proc_count); + } + return 0; +} + +static DWORD WINAPI proc_thread(void *arg) Have you thought about merging the two thread functions into one? They basically do the exact same thing except for the d3dx functions they call and the queue / counter / lock they work on. The generic thread function could take a "role" parameter and key the stage-specific behavior off of it.
I haven't actually tried the idea, it might be too confusing and not be worth it. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/272#note_2440