mirror of https://github.com/PCSX2/pcsx2.git
CDVD: check if CDVD thread is already open
This commit is contained in:
parent
656efa5e20
commit
4df5c0ee1e
|
@ -144,12 +144,15 @@ void keepAliveThread()
|
|||
|
||||
bool StartKeepAliveThread()
|
||||
{
|
||||
s_keepalive_is_open = true;
|
||||
try {
|
||||
s_keepalive_thread = std::thread(keepAliveThread);
|
||||
}
|
||||
catch (std::system_error&) {
|
||||
s_keepalive_is_open = false;
|
||||
if (s_keepalive_is_open == false)
|
||||
{
|
||||
s_keepalive_is_open = true;
|
||||
try {
|
||||
s_keepalive_thread = std::thread(keepAliveThread);
|
||||
}
|
||||
catch (std::system_error&) {
|
||||
s_keepalive_is_open = false;
|
||||
}
|
||||
}
|
||||
|
||||
return s_keepalive_is_open;
|
||||
|
|
|
@ -243,13 +243,15 @@ void cdvdThread()
|
|||
|
||||
bool cdvdStartThread()
|
||||
{
|
||||
cdvd_is_open = true;
|
||||
try {
|
||||
s_thread = std::thread(cdvdThread);
|
||||
}
|
||||
catch (std::system_error&) {
|
||||
cdvd_is_open = false;
|
||||
return false;
|
||||
if (cdvd_is_open == false)
|
||||
{
|
||||
cdvd_is_open = true;
|
||||
try {
|
||||
s_thread = std::thread(cdvdThread);
|
||||
} catch (std::system_error &) {
|
||||
cdvd_is_open = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
cdvdCacheReset();
|
||||
|
|
Loading…
Reference in New Issue