mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-01-24 21:49:21 -06:00
sys: std::jthread -> std::thread to support libc++
This commit is contained in:
@@ -52,7 +52,7 @@ class GDBProvider : public hex::prv::Provider {
|
||||
|
||||
std::list<CacheLine> m_cache;
|
||||
|
||||
std::jthread m_cacheUpdateThread;
|
||||
std::thread m_cacheUpdateThread;
|
||||
std::mutex m_cacheLock;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/event.hpp>
|
||||
|
||||
#include "content/providers/file_provider.hpp"
|
||||
#include "content/providers/gdb_provider.hpp"
|
||||
#include "content/providers/file_provider.hpp"
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
@@ -222,9 +222,9 @@ namespace hex::plugin::builtin::prv {
|
||||
this->m_port = port;
|
||||
|
||||
if (this->m_socket.isConnected()) {
|
||||
this->m_cacheUpdateThread = std::jthread([this](const std::stop_token& stopToken) {
|
||||
this->m_cacheUpdateThread = std::thread([this]() {
|
||||
auto cacheLine = this->m_cache.begin();
|
||||
while (!stopToken.stop_requested()) {
|
||||
while (this->isConnected()) {
|
||||
{
|
||||
std::scoped_lock lock(this->m_cacheLock);
|
||||
|
||||
@@ -253,7 +253,6 @@ namespace hex::plugin::builtin::prv {
|
||||
this->m_socket.disconnect();
|
||||
|
||||
if (this->m_cacheUpdateThread.joinable()) {
|
||||
this->m_cacheUpdateThread.request_stop();
|
||||
this->m_cacheUpdateThread.join();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user