I can't speak about the conceptual correctness of this patch, although my gut feeling says that you're right.
You don't need wined3d_wndproc_mutex_(un)lock. Just use EnterCriticalSection / LeaveCriticalSection directly. wined3d_mutex_lock exists because it is exported from wined3d.
On Friday 17 June 2011 21:49:38 Piotr Pawlow wrote:
If CreateDevice is called with hFocusWindow belonging to another thread, then any code that does SendMessage (or equivalent) to the window while holding the main wined3d mutex causes a deadlock, because wined3d_wndproc tries to acquire the same mutex for wndproc_table access. Using a different mutex for this purpose solves the problem.
dlls/wined3d/wined3d_main.c | 44 +++++++++++++++++++++++++++++++----------- 1 files changed, 32 insertions(+), 12 deletions(-)