You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2018/10/11 22:28:53 UTC

[trafficserver] branch master updated: Add some feeble amount of encapsulation to the Thread class.

This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d7c558  Add some feeble amount of encapsulation to the Thread class.
7d7c558 is described below

commit 7d7c5581e9c012be3d214cfecf33cc146059d8fe
Author: Walter Karas <wk...@oath.com>
AuthorDate: Thu Oct 4 15:10:54 2018 -0500

    Add some feeble amount of encapsulation to the Thread class.
---
 iocore/eventsystem/I_Thread.h | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/iocore/eventsystem/I_Thread.h b/iocore/eventsystem/I_Thread.h
index 5ffea6e..0545d6c 100644
--- a/iocore/eventsystem/I_Thread.h
+++ b/iocore/eventsystem/I_Thread.h
@@ -92,10 +92,6 @@ using ThreadFunction = std::function<void()>;
 class Thread
 {
 public:
-  /*-------------------------------------------*\
-  | Common Interface                            |
-  \*-------------------------------------------*/
-
   /**
     System-wide thread identifier. The thread identifier is represented
     by the platform independent type ink_thread and it is the system-wide
@@ -113,15 +109,8 @@ public:
   */
   Ptr<ProxyMutex> mutex;
 
-  // PRIVATE
-  Thread();
-  Thread(const Thread &) = delete;
-  Thread &operator=(const Thread &) = delete;
-  virtual ~Thread();
-
   void set_specific();
 
-  static ink_hrtime cur_time;
   inkcoreapi static ink_thread_key thread_data_key;
 
   // For THREAD_ALLOC
@@ -143,7 +132,6 @@ public:
   ProxyAllocator ioAllocator;
   ProxyAllocator ioBlockAllocator;
 
-public:
   /** Start the underlying thread.
 
       The thread name is set to @a name. The stack for the thread is either @a stack or, if that is
@@ -171,6 +159,15 @@ public:
       @note This also updates the cached time.
   */
   static ink_hrtime get_hrtime_updated();
+
+  Thread(const Thread &) = delete;
+  Thread &operator=(const Thread &) = delete;
+  virtual ~Thread();
+
+protected:
+  Thread();
+
+  static ink_hrtime cur_time;
 };
 
 extern Thread *this_thread();