Bugfix: TFB_DRAWCOMMANDTYPE_REINITVIDEO is allowed to be queued from the main() thread
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3777 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -226,7 +226,7 @@ TFB_DrawCommandQueue_Clear ()
|
||||
}
|
||||
|
||||
static void
|
||||
checkExclusiveThread (void)
|
||||
checkExclusiveThread (TFB_DrawCommand* DrawCommand)
|
||||
{
|
||||
#ifdef DEBUG_DCQ_THREADS
|
||||
static uint32 exclusiveThreadId;
|
||||
@@ -234,10 +234,18 @@ checkExclusiveThread (void)
|
||||
|
||||
// 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 @@ TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand)
|
||||
return;
|
||||
}
|
||||
|
||||
checkExclusiveThread ();
|
||||
checkExclusiveThread (DrawCommand);
|
||||
|
||||
if (DrawCommand->Type <= TFB_DRAWCOMMANDTYPE_COPYTOIMAGE
|
||||
&& _CurFramePtr->Type == SCREEN_DRAWABLE)
|
||||
|
||||
Reference in New Issue
Block a user