core: move all shared_ptrs from the STL to hyprutils (#9143)

This commit is contained in:
Vaxry 2025-01-23 21:55:41 +01:00 committed by GitHub
parent ae403e6a05
commit 0a1ae48a9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
152 changed files with 297 additions and 349 deletions

View file

@ -8,7 +8,7 @@
#include "WLClasses.hpp"
#include <vector>
#include <array>
#include <memory>
#include <xf86drmMode.h>
#include "Timer.hpp"
#include "math/Math.hpp"

View file

@ -1,7 +1,7 @@
#include "SdDaemon.hpp"
#include "memory/Memory.hpp"
#include <memory>
#include <fcntl.h>
#include <unistd.h>
#include <cerrno>

View file

@ -14,7 +14,7 @@ CWatchdog::~CWatchdog() {
CWatchdog::CWatchdog() : m_iMainThreadPID(pthread_self()) {
m_pWatchdog = std::make_unique<std::thread>([this] {
m_pWatchdog = makeUnique<std::thread>([this] {
static auto PTIMEOUT = CConfigValue<Hyprlang::INT>("debug:watchdog_timeout");
m_bWatchdogInitialized = true;

View file

@ -1,6 +1,6 @@
#pragma once
#include <memory>
#include "memory/Memory.hpp"
#include <chrono>
#include <thread>
#include <condition_variable>
@ -24,11 +24,11 @@ class CWatchdog {
std::atomic<bool> m_bWatching = false;
std::atomic<bool> m_bWillWatch = false;
std::unique_ptr<std::thread> m_pWatchdog;
UP<std::thread> m_pWatchdog;
std::mutex m_mWatchdogMutex;
std::atomic<bool> m_bNotified = false;
std::atomic<bool> m_bExitThread = false;
std::condition_variable m_cvWatchdogCondition;
};
inline std::unique_ptr<CWatchdog> g_pWatchdog;
inline UP<CWatchdog> g_pWatchdog;

View file

@ -7,4 +7,4 @@ using namespace Hyprutils::Memory;
#define SP Hyprutils::Memory::CSharedPointer
#define WP Hyprutils::Memory::CWeakPointer
#define UP std::unique_ptr
#define UP Hyprutils::Memory::CUniquePointer