Disabled Qt/SDL mutex lock debug code.

This commit is contained in:
mjbudd77 2021-12-31 07:01:57 -05:00
parent 31a859b6df
commit b4734ac45f
1 changed files with 16 additions and 16 deletions

View File

@ -1219,13 +1219,16 @@ static void DoFun(int frameskip, int periodic_saves)
}
static std::string lockFile;
static bool debugMutexLock = false;
void fceuWrapperLock(const char *filename, int line, const char *func)
{
char txt[32];
fceuWrapperLock();
if ( debugMutexLock )
{
char txt[32];
if ( mutexLocks > 1 )
{
printf("Recursive Lock:%i\n", mutexLocks );
@ -1236,6 +1239,7 @@ void fceuWrapperLock(const char *filename, int line, const char *func)
lockFile.assign(filename);
lockFile.append(txt);
lockFile.append(func);
}
}
void fceuWrapperLock(void)
@ -1246,22 +1250,18 @@ void fceuWrapperLock(void)
consoleWindow->mutex->lock();
}
mutexPending--;
if ( mutexLocks > 0 )
{
printf("Recursive Lock:%i\n", mutexLocks );
}
mutexLocks++;
}
bool fceuWrapperTryLock(const char *filename, int line, const char *func, int timeout)
{
char txt[32];
bool lockAcq = false;
lockAcq = fceuWrapperTryLock( timeout );
if ( lockAcq )
if ( lockAcq && debugMutexLock)
{
char txt[32];
sprintf( txt, ":%i - ", line );
lockFile.assign(filename);
lockFile.append(txt);