From ec2263538d479738ec7665ced4e4c4e5a21be890 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Wed, 1 May 2024 17:54:31 +0800 Subject: [PATCH] feat remove thread check --- src/sled/system/thread.h | 8 ++++---- src/sled/task_queue/pending_task_safety_flag.cc | 8 ++++---- src/sled/task_queue/pending_task_safety_flag.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/sled/system/thread.h b/src/sled/system/thread.h index 339cae2..ef8a21a 100644 --- a/src/sled/system/thread.h +++ b/src/sled/system/thread.h @@ -40,7 +40,7 @@ private: void ProcessAllMessageQueuesForTesting(); ThreadManager(); ~ThreadManager(); - ThreadManager(const ThreadManager &) = delete; + ThreadManager(const ThreadManager &) = delete; ThreadManager &operator=(const ThreadManager &) = delete; std::vector message_queues_; @@ -56,7 +56,7 @@ public: Thread(SocketServer *ss, bool do_init); Thread(std::unique_ptr ss, bool do_init); ~Thread() override; - Thread(const Thread &) = delete; + Thread(const Thread &) = delete; Thread &operator=(const Thread &) = delete; static std::unique_ptr CreateWithSocketServer(); @@ -103,7 +103,7 @@ protected: bool operator<(const DelayedMessage &dmsg) const { return (dmsg.run_time_ms < run_time_ms) - || ((dmsg.run_time_ms == run_time_ms) && (dmsg.message_number < message_number)); + || ((dmsg.run_time_ms == run_time_ms) && (dmsg.message_number < message_number)); } int64_t delay_ms; @@ -156,7 +156,7 @@ public: explicit AutoSocketServerThread(SocketServer *ss); ~AutoSocketServerThread() override; - AutoSocketServerThread(const AutoSocketServerThread &) = delete; + AutoSocketServerThread(const AutoSocketServerThread &) = delete; AutoSocketServerThread &operator=(const AutoSocketServerThread &) = delete; private: diff --git a/src/sled/task_queue/pending_task_safety_flag.cc b/src/sled/task_queue/pending_task_safety_flag.cc index 44bed19..83328bb 100644 --- a/src/sled/task_queue/pending_task_safety_flag.cc +++ b/src/sled/task_queue/pending_task_safety_flag.cc @@ -27,28 +27,28 @@ sled::scoped_refptr PendingTaskSafetyFlag::CreateDetachedInactive() { scoped_refptr safety_flag = CreateInternal(false); - safety_flag->main_sequence_.Detach(); + // safety_flag->main_sequence_.Detach(); return safety_flag; } void PendingTaskSafetyFlag::SetNotAlive() { - SLED_DCHECK_RUN_ON(&main_sequence_); + // SLED_DCHECK_RUN_ON(&main_sequence_); alive_ = false; } void PendingTaskSafetyFlag::SetAlive() { - SLED_DCHECK_RUN_ON(&main_sequence_); + // SLED_DCHECK_RUN_ON(&main_sequence_); alive_ = true; } bool PendingTaskSafetyFlag::alive() const { - SLED_DCHECK_RUN_ON(&main_sequence_); + // SLED_DCHECK_RUN_ON(&main_sequence_); return alive_; } diff --git a/src/sled/task_queue/pending_task_safety_flag.h b/src/sled/task_queue/pending_task_safety_flag.h index c05abe5..09fb52d 100644 --- a/src/sled/task_queue/pending_task_safety_flag.h +++ b/src/sled/task_queue/pending_task_safety_flag.h @@ -32,7 +32,7 @@ protected: private: static sled::scoped_refptr CreateInternal(bool alive); - bool alive_ = true; + std::atomic alive_{true}; SequenceChecker main_sequence_; };