mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 10:42:36 +01:00
tcp_timeout_monitor deadlock fix (#8783)
This commit is contained in:
parent
bd40430d2b
commit
4317291827
@ -255,7 +255,7 @@ static void network_clear_queue(ppu_thread& ppu)
|
||||
// Object in charge of retransmiting packets for STREAM_P2P sockets
|
||||
class tcp_timeout_monitor
|
||||
{
|
||||
public:
|
||||
public:
|
||||
void add_message(s32 sock_id, const sockaddr_in *dst, std::vector<u8> data, u64 seq)
|
||||
{
|
||||
{
|
||||
@ -306,6 +306,9 @@ class tcp_timeout_monitor
|
||||
else
|
||||
wakey.wait(lock);
|
||||
|
||||
if (abort)
|
||||
return;
|
||||
|
||||
const auto now = std::chrono::system_clock::now();
|
||||
// Check for messages that haven't been acked
|
||||
std::set<s32> rtt_increased;
|
||||
@ -368,11 +371,12 @@ class tcp_timeout_monitor
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
std::condition_variable wakey;
|
||||
static constexpr auto thread_name = "Tcp Over Udp Timeout Manager Thread"sv;
|
||||
static constexpr auto thread_name = "Tcp Over Udp Timeout Manager Thread"sv;
|
||||
std::atomic<bool> abort = false;
|
||||
|
||||
private:
|
||||
private:
|
||||
std::mutex data_mutex;
|
||||
// List of outgoing messages
|
||||
struct message
|
||||
@ -835,6 +839,7 @@ struct network_thread
|
||||
WSACleanup();
|
||||
#endif
|
||||
auto tcpm = g_fxo->get<named_thread<tcp_timeout_monitor>>();
|
||||
tcpm->abort = true;
|
||||
tcpm->wakey.notify_one();
|
||||
}
|
||||
|
||||
|
@ -52,10 +52,10 @@ rpcn_client::~rpcn_client()
|
||||
|
||||
std::string rpcn_client::get_wolfssl_error(int error)
|
||||
{
|
||||
std::string error_string(80, '\0');
|
||||
char error_string[80]{};
|
||||
auto wssl_err = wolfSSL_get_error(wssl, error);
|
||||
wolfSSL_ERR_error_string(wssl_err, &error_string[0]);
|
||||
return error_string;
|
||||
return std::string(error_string);
|
||||
}
|
||||
|
||||
void rpcn_client::disconnect()
|
||||
|
Loading…
Reference in New Issue
Block a user