feat remove thread check
Some checks failed
linux-arm-gcc / linux-gcc-armhf (push) Successful in 1m43s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Successful in 2m1s
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 2m10s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 2m16s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Successful in 3m6s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Failing after 3h14m16s

This commit is contained in:
tqcq 2024-05-01 17:54:31 +08:00
parent 11c5cd64fe
commit ec2263538d
3 changed files with 9 additions and 9 deletions

View File

@ -40,7 +40,7 @@ private:
void ProcessAllMessageQueuesForTesting();
ThreadManager();
~ThreadManager();
ThreadManager(const ThreadManager &) = delete;
ThreadManager(const ThreadManager &) = delete;
ThreadManager &operator=(const ThreadManager &) = delete;
std::vector<Thread *> message_queues_;
@ -56,7 +56,7 @@ public:
Thread(SocketServer *ss, bool do_init);
Thread(std::unique_ptr<SocketServer> ss, bool do_init);
~Thread() override;
Thread(const Thread &) = delete;
Thread(const Thread &) = delete;
Thread &operator=(const Thread &) = delete;
static std::unique_ptr<Thread> 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:

View File

@ -27,28 +27,28 @@ sled::scoped_refptr<PendingTaskSafetyFlag>
PendingTaskSafetyFlag::CreateDetachedInactive()
{
scoped_refptr<PendingTaskSafetyFlag> 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_;
}

View File

@ -32,7 +32,7 @@ protected:
private:
static sled::scoped_refptr<PendingTaskSafetyFlag> CreateInternal(bool alive);
bool alive_ = true;
std::atomic<bool> alive_{true};
SequenceChecker main_sequence_;
};