trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [trafficserver] 01/02: TS-4883: Remove default arguments from Thread::start
Date Mon, 26 Sep 2016 18:19:33 GMT
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 80fc50139e9784e21a5205f9381923dd94c33e92
Author: Phil Sorber <sorber@apache.org>
AuthorDate: Mon Sep 26 10:20:24 2016 -0600

    TS-4883: Remove default arguments from Thread::start
---
 iocore/eventsystem/I_Thread.h            | 3 +--
 iocore/eventsystem/Thread.cc             | 3 +++
 iocore/eventsystem/UnixEventProcessor.cc | 4 ++--
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/iocore/eventsystem/I_Thread.h b/iocore/eventsystem/I_Thread.h
index 528cdbf..007a789 100644
--- a/iocore/eventsystem/I_Thread.h
+++ b/iocore/eventsystem/I_Thread.h
@@ -145,8 +145,7 @@ private:
   Thread &operator=(const Thread &);
 
 public:
-  ink_thread start(const char *name, size_t stacksize = DEFAULT_STACKSIZE, ThreadFunction
f = NULL, void *a = NULL,
-                   void *stack = NULL);
+  ink_thread start(const char *name, size_t stacksize, ThreadFunction f, void *a, void *stack);
 
   virtual void
   execute()
diff --git a/iocore/eventsystem/Thread.cc b/iocore/eventsystem/Thread.cc
index f9ef1a3..180bead 100644
--- a/iocore/eventsystem/Thread.cc
+++ b/iocore/eventsystem/Thread.cc
@@ -96,6 +96,9 @@ Thread::start(const char *name, size_t stacksize, ThreadFunction f, void
*a, voi
   p->me = this;
   memset(p->name, 0, MAX_THREAD_NAME_LENGTH);
   ink_strlcpy(p->name, name, MAX_THREAD_NAME_LENGTH);
+  if (stacksize == 0) {
+    stacksize = DEFAULT_STACKSIZE;
+  }
   tid = ink_thread_create(spawn_thread_internal, (void *)p, 0, stacksize, stack);
 
   return tid;
diff --git a/iocore/eventsystem/UnixEventProcessor.cc b/iocore/eventsystem/UnixEventProcessor.cc
index 6ca2b1a..49476e4 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -55,7 +55,7 @@ EventProcessor::spawn_event_threads(int n_threads, const char *et_name,
size_t s
   n_threads_for_type[new_thread_group_id] = n_threads;
   for (i = 0; i < n_threads; i++) {
     snprintf(thr_name, MAX_THREAD_NAME_LENGTH, "[%s %d]", et_name, i);
-    eventthread[new_thread_group_id][i]->start(thr_name, stacksize);
+    eventthread[new_thread_group_id][i]->start(thr_name, stacksize, NULL, NULL, NULL);
   }
 
   n_thread_groups++;
@@ -273,7 +273,7 @@ EventProcessor::spawn_thread(Continuation *cont, const char *thr_name,
size_t st
   e->ethread               = all_dthreads[n_dthreads];
   e->mutex = e->continuation->mutex = all_dthreads[n_dthreads]->mutex;
   n_dthreads++;
-  e->ethread->start(thr_name, stacksize);
+  e->ethread->start(thr_name, stacksize, NULL, NULL, NULL);
 
   return e;
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>.

Mime
View raw message