Procházet zdrojové kódy

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.
kleines Filmröllchen před 2 roky
rodič
revize
9e40d4ccd6

+ 6 - 0
Userland/Libraries/LibThreading/Thread.cpp

@@ -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(

+ 3 - 3
Userland/Libraries/LibThreading/Thread.h

@@ -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 = {});