[network, qt] use jthread and use std::vector for packet list instead of std::list (#254)

Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/254
Reviewed-by: DraVee <dravee@eden-emu.dev>
Reviewed-by: Maufeat <sahyno1996@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2026-02-11 03:00:15 +01:00 committed by crueter
parent 28a78d76fe
commit 19494bc7ac
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
11 changed files with 305 additions and 403 deletions

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -72,7 +72,9 @@ public:
/**
* Whether the announce session is still running
*/
bool IsRunning() const;
[[nodiscard]] bool IsRunning() const {
return announce_multiplayer_thread.has_value();
}
/**
* Recreates the backend, updating the credentials.
@ -82,16 +84,13 @@ public:
private:
void UpdateBackendData(std::shared_ptr<Network::Room> room);
void AnnounceMultiplayerLoop();
Common::Event shutdown_event;
std::mutex callback_mutex;
std::set<CallbackHandle> error_callbacks;
std::unique_ptr<std::thread> announce_multiplayer_thread;
std::optional<std::jthread> announce_multiplayer_thread;
/// Backend interface that logs fields
std::unique_ptr<AnnounceMultiplayerRoom::Backend> backend;
std::mutex callback_mutex;
std::atomic_bool registered = false; ///< Whether the room has been registered
};