You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/04/16 15:10:33 UTC

[trafficserver] branch master updated: TSThreadFunc should return a pointer

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

maskit 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 bc38879  TSThreadFunc should return a pointer
bc38879 is described below

commit bc38879668c29b919c9c386451bc08df1b3642bb
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Mon Apr 16 16:14:33 2018 +0900

    TSThreadFunc should return a pointer
---
 example/thread_pool/psi.c    | 2 +-
 example/thread_pool/thread.c | 3 ++-
 example/thread_pool/thread.h | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/example/thread_pool/psi.c b/example/thread_pool/psi.c
index a3b73a8..80e369c 100644
--- a/example/thread_pool/psi.c
+++ b/example/thread_pool/psi.c
@@ -987,7 +987,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
   for (i = 0; i < NB_THREADS; i++) {
     char *thread_name = (char *)TSmalloc(64);
     sprintf(thread_name, "Thread[%d]", i);
-    if (!TSThreadCreate((TSThreadFunc)thread_loop, thread_name)) {
+    if (!TSThreadCreate(thread_loop, thread_name)) {
       TSError("[%s] Failed creating threads", PLUGIN_NAME);
       return;
     }
diff --git a/example/thread_pool/thread.c b/example/thread_pool/thread.c
index be41cfc..3800388 100644
--- a/example/thread_pool/thread.c
+++ b/example/thread_pool/thread.c
@@ -154,7 +154,7 @@ thread_init()
   pthread_cond_init(&cond, NULL);
 }
 
-void
+void *
 thread_loop(void *arg ATS_UNUSED)
 {
   Job *job_todo;
@@ -179,4 +179,5 @@ thread_loop(void *arg ATS_UNUSED)
       pthread_mutex_unlock(&cond_mutex);
     }
   }
+  return NULL;
 }
diff --git a/example/thread_pool/thread.h b/example/thread_pool/thread.h
index 369461f..f0eaa62 100644
--- a/example/thread_pool/thread.h
+++ b/example/thread_pool/thread.h
@@ -77,4 +77,4 @@ void thread_signal_job();
 
 void thread_init();
 
-void thread_loop(void *arg);
+void *thread_loop(void *arg);

-- 
To stop receiving notification emails like this one, please contact
maskit@apache.org.