From 9e40d4ccd66ee59460ee93df8fb315eb81cc78c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Sat, 12 Nov 2022 12:57:21 +0100 Subject: [PATCH] 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. --- Userland/Libraries/LibThreading/Thread.cpp | 6 ++++++ Userland/Libraries/LibThreading/Thread.h | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibThreading/Thread.cpp b/Userland/Libraries/LibThreading/Thread.cpp index 0c28d3d51d8..632c653ed85 100644 --- a/Userland/Libraries/LibThreading/Thread.cpp +++ b/Userland/Libraries/LibThreading/Thread.cpp @@ -52,6 +52,12 @@ ErrorOr 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( diff --git a/Userland/Libraries/LibThreading/Thread.h b/Userland/Libraries/LibThreading/Thread.h index 5b3c79973c2..5663fbee676 100644 --- a/Userland/Libraries/LibThreading/Thread.h +++ b/Userland/Libraries/LibThreading/Thread.h @@ -33,9 +33,9 @@ public: template Result 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 action, StringView thread_name = {});