Re: DDraw: Protect IDirectDrawImpl against race conditions
Stefan Dösinger <stefandoesinger(a)gmx.at> writes:
@@ -356,6 +373,8 @@ IDirectDrawImpl_SetupFullscreenWindow(ID * Helper function that restores a windows' properties when taking it out * of fullscreen mode * + * Assumes that the critical section is properly held + *
This seems dangerous, changing the window size will potentially send messages to other threads, so doing it inside the lock can cause deadlocks. -- Alexandre Julliard julliard(a)winehq.org
Am Donnerstag 07 Dezember 2006 21:17 schrieben Sie:
Stefan Dösinger <stefandoesinger(a)gmx.at> writes:
@@ -356,6 +373,8 @@ IDirectDrawImpl_SetupFullscreenWindow(ID * Helper function that restores a windows' properties when taking it out * of fullscreen mode * + * Assumes that the critical section is properly held + *
This seems dangerous, changing the window size will potentially send messages to other threads, so doing it inside the lock can cause deadlocks. So I should unlock before I change the window size?
Stefan Dösinger <stefandoesinger(a)gmx.at> writes:
Am Donnerstag 07 Dezember 2006 21:17 schrieben Sie:
This seems dangerous, changing the window size will potentially send messages to other threads, so doing it inside the lock can cause deadlocks. So I should unlock before I change the window size?
Probably, though I guess that depends on what the Windows behavior is with windows and multiple threads. -- Alexandre Julliard julliard(a)winehq.org
Am Montag 11 Dezember 2006 15:39 schrieb Alexandre Julliard:
Stefan Dösinger <stefandoesinger(a)gmx.at> writes:
Am Donnerstag 07 Dezember 2006 21:17 schrieben Sie:
This seems dangerous, changing the window size will potentially send messages to other threads, so doing it inside the lock can cause deadlocks.
So I should unlock before I change the window size?
Probably, though I guess that depends on what the Windows behavior is with windows and multiple threads. I have to read up the msdn and propably write tests for it, but there are some methods which must be called from the thread that created the device. SetDisplayMode and RestoreDisplayMode are 2 examples, I *think* it applies SetCooperativeLevel too. It would make sense because SetCooperativeLevel is the method used to turn on multithreading protection.
participants (2)
-
Alexandre Julliard -
Stefan Dösinger