You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2016/05/11 20:31:34 UTC
[trafficserver] 10/33: TS-4425: Remove unused Mutex pointers from
the threads system.
This is an automated email from the ASF dual-hosted git repository.
jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit f474472f468b2ee5400af4662ab5034abeb4be5b
Author: James Peach <jp...@apache.org>
AuthorDate: Thu May 5 20:46:07 2016 -0700
TS-4425: Remove unused Mutex pointers from the threads system.
---
iocore/eventsystem/I_Thread.h | 14 ++++----------
iocore/eventsystem/Thread.cc | 2 --
iocore/eventsystem/UnixEventProcessor.cc | 1 -
3 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/iocore/eventsystem/I_Thread.h b/iocore/eventsystem/I_Thread.h
index 2d4fcb7..f24bb99 100644
--- a/iocore/eventsystem/I_Thread.h
+++ b/iocore/eventsystem/I_Thread.h
@@ -61,20 +61,15 @@
#if !defined(_I_EventSystem_h) && !defined(_P_EventSystem_h)
#error "include I_EventSystem.h or P_EventSystem.h"
--- - include I_Event.h or
- P_Event.h
#endif
+
#include "ts/ink_platform.h"
#include "ts/ink_thread.h"
#include "I_ProxyAllocator.h"
- class Thread;
-class ProxyMutex;
-#define THREADAPI
-#define THREADAPI_RETURN_TYPE void *
-typedef THREADAPI_RETURN_TYPE(THREADAPI *ThreadFunction)(void *arg);
-
-extern ProxyMutex *global_mutex;
+class Thread;
+class ProxyMutex;
+typedef void *(*ThreadFunction)(void *arg);
static const int MAX_THREAD_NAME_LENGTH = 16;
static const int DEFAULT_STACKSIZE = 1048576; // 1MB
@@ -124,7 +119,6 @@ public:
static ink_hrtime cur_time;
inkcoreapi static ink_thread_key thread_data_key;
- Ptr<ProxyMutex> mutex_ptr;
// For THREAD_ALLOC
ProxyAllocator eventAllocator;
diff --git a/iocore/eventsystem/Thread.cc b/iocore/eventsystem/Thread.cc
index 03af6db..86c74ea 100644
--- a/iocore/eventsystem/Thread.cc
+++ b/iocore/eventsystem/Thread.cc
@@ -37,14 +37,12 @@
static ink_thread_key init_thread_key();
-ProxyMutex *global_mutex = NULL;
ink_hrtime Thread::cur_time = 0;
inkcoreapi ink_thread_key Thread::thread_data_key = init_thread_key();
Thread::Thread()
{
mutex = new_ProxyMutex();
- mutex_ptr = mutex;
MUTEX_TAKE_LOCK(mutex, (EThread *)this);
mutex->nthread_holding = THREAD_MUTEX_THREAD_HOLDING;
}
diff --git a/iocore/eventsystem/UnixEventProcessor.cc b/iocore/eventsystem/UnixEventProcessor.cc
index 0c4e410..549c6f2 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -85,7 +85,6 @@ EventProcessor::start(int n_event_threads, size_t stacksize)
EThread *t = new EThread(REGULAR, i);
if (i == 0) {
ink_thread_setspecific(Thread::thread_data_key, t);
- global_mutex = t->mutex;
Thread::get_hrtime_updated();
}
all_ethreads[i] = t;
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.