Skip to content

ScopedMutex in Zero Hour looks dangerous, has timeout of 500 milliseconds #805

Open
@xezon

Description

@xezon

Generals

		ScopedMutex(HANDLE mutex) : m_mutex(mutex)
		{
			WaitForSingleObject(m_mutex, INFINITE);
		}

Zero Hour

		ScopedMutex(HANDLE mutex) : m_mutex(mutex)
		{
			DWORD status = WaitForSingleObject(m_mutex, 500);
			if (status != WAIT_OBJECT_0) {
				DEBUG_LOG(("ScopedMutex WaitForSingleObject timed out - status %d\n", status));
			}
		}

Using a timeout of 500 milliseconds for a mutex is bonkers. Unclear what the rationale here was but this looks like a bug, albeit an unlikely one.

The scoped mutex is used exclusively in MilesAudioManager.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions