Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ struct AudioDeviceHelper : public DeviceHelper<DEVICE_CLASS> {
CloseHandle(_hThread);
_hThread = nullptr;
_transporting = false;
_transportInitialized = false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be set to false on line 630 to avoid setting the same value in two places? Or would that introduce a potential race condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that there's the risk of a race condition, as if you see _transporting was set to false in both places even before my change.

_mixerInitialized = false;
return -1;
}

Expand All @@ -647,6 +649,8 @@ struct AudioDeviceHelper : public DeviceHelper<DEVICE_CLASS> {
ResetEvent(_hShutdownEvent);

_transporting = false;
_transportInitialized = false;
_mixerInitialized = false;

CloseHandle(_hThread);
_hThread = nullptr;
Expand Down