Locking fixes (#504)

You *must* hold the GraphicsLock when calling SetFlashRect.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1265 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2003-10-08 01:24:35 +00:00
parent 47cb238191
commit 37683f849f
3 changed files with 6 additions and 0 deletions
+2
View File
@@ -1,4 +1,6 @@
Changes towards version 0.4: Changes towards version 0.4:
- Patches to enforce the invariant that the GraphicsLock is held when
SetFlashRect is called (bug #504) -Michael
- Major refactoring of threadlib; see doc/devel/threads -Michael - Major refactoring of threadlib; see doc/devel/threads -Michael
- Downgraded the GraphicsLock to an ordinary Mutex -Michael - Downgraded the GraphicsLock to an ordinary Mutex -Michael
- Added movie player; only movies defined are intro and ending; - Added movie player; only movies defined are intro and ending;
+2
View File
@@ -1014,7 +1014,9 @@ Restart:
} }
else if (CurrentMenuState.cancel) else if (CurrentMenuState.cancel)
{ {
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0); SetFlashRect ((PRECT)~0L, (FRAME)0);
UnlockMutex (GraphicsLock);
pMS->ModuleFrame = 0; pMS->ModuleFrame = 0;
pMS->CurState = (BYTE)pMS->delta_item; pMS->CurState = (BYTE)pMS->delta_item;
ResumeMusic (); ResumeMusic ();
+2
View File
@@ -755,7 +755,9 @@ DoModifyShips (PMENU_STATE pMS)
else if (cancel) else if (cancel)
{ {
pMS->delta_item ^= MODIFY_CREW_FLAG; pMS->delta_item ^= MODIFY_CREW_FLAG;
LockMutex (GraphicsLock);
SetFlashRect ((PRECT)~0L, (FRAME)0); SetFlashRect ((PRECT)~0L, (FRAME)0);
UnlockMutex (GraphicsLock);
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW); DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
} }
else if (select) else if (select)