trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [01/34] git commit: TS-2538 Cleanup of ProcessMutex (unused) and InkMutex (dupe of ink_mutex)
Date Wed, 05 Feb 2014 00:30:08 GMT
Updated Branches:
  refs/heads/5.0.x 6629f2016 -> 5e19587e3


TS-2538 Cleanup of ProcessMutex (unused) and InkMutex (dupe of ink_mutex)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/556b53a4
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/556b53a4
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/556b53a4

Branch: refs/heads/5.0.x
Commit: 556b53a491f541dfe666f7b954b135e2f6446d3f
Parents: 4b6f7ae
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Tue Jan 28 15:39:09 2014 -0700
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Thu Jan 30 16:38:51 2014 -0700

----------------------------------------------------------------------
 lib/ts/ink_atomic.h               |  2 +-
 lib/ts/ink_mutex.cc               | 42 +---------------------------------
 lib/ts/ink_mutex.h                | 14 +-----------
 lib/ts/ink_queue_ext.h            |  2 +-
 proxy/http/HttpProxyServerMain.cc |  2 +-
 5 files changed, 5 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/556b53a4/lib/ts/ink_atomic.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_atomic.h b/lib/ts/ink_atomic.h
index fc8a9f3..47fb65b 100644
--- a/lib/ts/ink_atomic.h
+++ b/lib/ts/ink_atomic.h
@@ -171,7 +171,7 @@ ink_atomic_decrement(volatile Type * mem, Amount count) {
 
 // Special hacks for ARM 32-bit
 #if defined(__arm__) && (SIZEOF_VOIDP == 4)
-extern ProcessMutex __global_death;
+extern ink_mutex __global_death;
 
 template<>
 inline int64_t

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/556b53a4/lib/ts/ink_mutex.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_mutex.cc b/lib/ts/ink_mutex.cc
index e9ba5b0..9036f55 100644
--- a/lib/ts/ink_mutex.cc
+++ b/lib/ts/ink_mutex.cc
@@ -29,44 +29,4 @@
 
 x_pthread_mutexattr_t _g_mattr;
 
-ProcessMutex __global_death = PTHREAD_MUTEX_INITIALIZER;
-ProcessMutex *gobal_death_mutex = &__global_death;
-
-void
-ink_ProcessMutex_destroy(ProcessMutex * m)
-{
-  pthread_mutex_destroy(m);
-}
-
-void
-ink_ProcessMutex_acquire(ProcessMutex * m)
-{
-  if (pthread_mutex_lock(m) != 0) {
-    abort();
-  }
-}
-
-void
-ink_ProcessMutex_release(ProcessMutex * m)
-{
-  if (pthread_mutex_unlock(m) != 0) {
-    abort();
-  }
-}
-
-int
-ink_ProcessMutex_try_acquire(ProcessMutex * m)
-{
-  return pthread_mutex_trylock(m) == 0;
-}
-
-void
-ink_ProcessMutex_print(FILE * out, ProcessMutex * m)
-{
-  (void) out;
-  (void) m;
-  if(m == gobal_death_mutex)
-    fprintf(out, "Global ProcessMutex\n");
-  else
-    fprintf(out, "ProcessMutex\n");
-}
+ink_mutex __global_death = PTHREAD_MUTEX_INITIALIZER;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/556b53a4/lib/ts/ink_mutex.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_mutex.h b/lib/ts/ink_mutex.h
index 3e3c810..326d6bb 100644
--- a/lib/ts/ink_mutex.h
+++ b/lib/ts/ink_mutex.h
@@ -40,9 +40,7 @@
 #include <pthread.h>
 #include <stdlib.h>
 
-typedef pthread_mutex_t ProcessMutex;
-typedef ProcessMutex ink_mutex;
-typedef ProcessMutex InkMutex;
+typedef pthread_mutex_t ink_mutex;
 
 // just a wrapper so that the constructor gets executed
 // before the first call to ink_mutex_init();
@@ -115,16 +113,6 @@ ink_mutex_try_acquire(ink_mutex * m)
 
 #endif /* #if defined(POSIX_THREAD) */
 
-
-/* process mutex */
-
-void ink_ProcessMutex_destroy(ProcessMutex *);
-void ink_ProcessMutex_acquire(ProcessMutex *);
-void ink_ProcessMutex_release(ProcessMutex *);
-int ink_ProcessMutex_try_acquire(ProcessMutex *);
-void ink_ProcessMutex_print(FILE * out, ProcessMutex *);
-
-
 struct ink_scoped_mutex
 {
   explicit ink_scoped_mutex(ink_mutex& m) : mtx(m) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/556b53a4/lib/ts/ink_queue_ext.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_queue_ext.h b/lib/ts/ink_queue_ext.h
index 3a80260..22ee6c4 100644
--- a/lib/ts/ink_queue_ext.h
+++ b/lib/ts/ink_queue_ext.h
@@ -126,7 +126,7 @@ extern "C"
 
     uint32_t nr_thread_cache;
     InkThreadCache *pThreadCache;
-    InkMutex lock;
+    ink_mutex lock;
   } InkFreeList, *PInkFreeList;
 
   /* reclaimable freelist API */

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/556b53a4/proxy/http/HttpProxyServerMain.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpProxyServerMain.cc b/proxy/http/HttpProxyServerMain.cc
index ad02779..7c9b49d 100644
--- a/proxy/http/HttpProxyServerMain.cc
+++ b/proxy/http/HttpProxyServerMain.cc
@@ -40,7 +40,7 @@ HttpAccept *plugin_http_accept = NULL;
 HttpAccept *plugin_http_transparent_accept = 0;
 
 static SLL<SSLNextProtocolAccept> ssl_plugin_acceptors;
-static ProcessMutex ssl_plugin_mutex = PTHREAD_MUTEX_INITIALIZER;
+static ink_mutex ssl_plugin_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 bool
 ssl_register_protocol(const char * protocol, Continuation * contp)


Mime
View raw message