From: <av...@us...> - 2012-02-26 20:32:28
|
Revision: 3777 http://sc2.svn.sourceforge.net/sc2/?rev=3777&view=rev Author: avolkov Date: 2012-02-26 20:32:22 +0000 (Sun, 26 Feb 2012) Log Message: ----------- Bugfix: TFB_DRAWCOMMANDTYPE_REINITVIDEO is allowed to be queued from the main() thread Modified Paths: -------------- trunk/sc2/src/libs/graphics/dcqueue.c Modified: trunk/sc2/src/libs/graphics/dcqueue.c =================================================================== --- trunk/sc2/src/libs/graphics/dcqueue.c 2012-02-26 19:42:15 UTC (rev 3776) +++ trunk/sc2/src/libs/graphics/dcqueue.c 2012-02-26 20:32:22 UTC (rev 3777) @@ -226,7 +226,7 @@ } static void -checkExclusiveThread (void) +checkExclusiveThread (TFB_DrawCommand* DrawCommand) { #ifdef DEBUG_DCQ_THREADS static uint32 exclusiveThreadId; @@ -234,10 +234,18 @@ // Only one thread is currently allowed to enqueue commands // This is not a technical limitation but rather a semantical one atm. + if (DrawCommand->Type == TFB_DRAWCOMMANDTYPE_REINITVIDEO) + { // TFB_DRAWCOMMANDTYPE_REINITVIDEO is an exception + // It is queued from the main() thread, which is safe to do + return; + } + if (!exclusiveThreadId) exclusiveThreadId = SDL_ThreadID(); else assert (SDL_ThreadID() == exclusiveThreadId); +#else + (void) DrawCommand; // suppress unused warning #endif } @@ -249,7 +257,7 @@ return; } - checkExclusiveThread (); + checkExclusiveThread (DrawCommand); if (DrawCommand->Type <= TFB_DRAWCOMMANDTYPE_COPYTOIMAGE && _CurFramePtr->Type == SCREEN_DRAWABLE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |