sys: std::jthread -> std::thread to support libc++

This commit is contained in:
WerWolv
2021-12-07 23:36:28 +01:00
parent 808b051a3e
commit ea4f4c45cb
3 changed files with 4 additions and 5 deletions

View File

@@ -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;
};

View File

@@ -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 {

View File

@@ -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();
}
}