From 787e79c687b6d827d0cf7d6041fcd98418d46d62 Mon Sep 17 00:00:00 2001 From: Eladash <18193363+elad335@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:34:14 +0200 Subject: [PATCH] util\serialization_ext.cpp: Fixup --- rpcs3/Emu/savestate_utils.hpp | 2 +- rpcs3/util/serialization_ext.cpp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rpcs3/Emu/savestate_utils.hpp b/rpcs3/Emu/savestate_utils.hpp index eec58e6b30..66d445369c 100644 --- a/rpcs3/Emu/savestate_utils.hpp +++ b/rpcs3/Emu/savestate_utils.hpp @@ -21,7 +21,7 @@ struct hle_locks_t finalized = -2, }; - void lock(); + [[noreturn]] void lock(); bool try_lock(); void unlock(); bool try_finalize(std::function test); diff --git a/rpcs3/util/serialization_ext.cpp b/rpcs3/util/serialization_ext.cpp index ec47761ef1..c5cbdabebc 100644 --- a/rpcs3/util/serialization_ext.cpp +++ b/rpcs3/util/serialization_ext.cpp @@ -619,11 +619,6 @@ void compressed_serialization_file_handler::stream_data_prepare_thread_op() if (data.empty()) { // Abort is requested, flush data and exit - if (!m_stream_data.empty()) - { - stream.m_queued_data_to_write.push(std::move(m_stream_data)); - } - stream.m_queued_data_to_write.push(std::vector()); return; } @@ -665,11 +660,6 @@ void compressed_serialization_file_handler::stream_data_prepare_thread_op() return; } - if (!buffer_offset) - { - continue; - } - // Forward for file write const usz queued_size = data.size(); @@ -686,6 +676,16 @@ void compressed_serialization_file_handler::stream_data_prepare_thread_op() // Ensure wait bit state has not changed by the update ensure(~((new_val - size_diff) ^ new_val) & pending_data_wait_bit); + if (!buffer_offset) + { + if (m_pending_signal) + { + m_pending_bytes.notify_all(); + } + + continue; + } + m_stream_data.resize(buffer_offset); stream.m_queued_data_to_write.push(std::move(m_stream_data)); }