LibThreading: Move now-trivial accessors of Thread to cpp file

Some of these might be changed in the future, and because Thread.h is a
commonly included header file, we don't want to change it as much as
possible.
This commit is contained in:
kleines Filmröllchen 2022-11-12 12:57:21 +01:00 committed by Andrew Kaster
parent 7fd7562140
commit 9e40d4ccd6
Notes: sideshowbarker 2024-07-17 03:24:32 +09:00
2 changed files with 9 additions and 3 deletions

View file

@ -52,6 +52,12 @@ ErrorOr<int> Thread::get_priority() const
return scheduling_parameters.sched_priority;
}
DeprecatedString Thread::thread_name() const { return m_thread_name; }
pthread_t Thread::tid() const { return m_tid; }
bool Thread::is_started() const { return m_started; }
void Thread::start()
{
int rc = pthread_create(

View file

@ -33,9 +33,9 @@ public:
template<typename T = void>
Result<T, ThreadError> join();
DeprecatedString thread_name() const { return m_thread_name; }
pthread_t tid() const { return m_tid; }
bool is_started() const { return m_started; }
DeprecatedString thread_name() const;
pthread_t tid() const;
bool is_started() const;
private:
explicit Thread(Function<intptr_t()> action, StringView thread_name = {});