From abff1fc785dcf5e89938f205acd2c53e6c7c766d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 15 Apr 2009 19:12:17 +0000 Subject: [PATCH] wthread.c: Rename file-scoped type to avoid shadows. * exec/wthread.c (struct worker_thread_t): Rename from struct worker_thread. (start_worker_thread): Rename from function "worker_thread". * exec/wthread.h (struct worker_thread_group) [threads]: Update member type: s/struct worker_thread/struct worker_thread_t/ git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2068 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/wthread.c | 14 +++++++------- exec/wthread.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/exec/wthread.c b/exec/wthread.c index aeabb8bb..791fb425 100644 --- a/exec/wthread.c +++ b/exec/wthread.c @@ -52,7 +52,7 @@ struct thread_data { void *data; }; -struct worker_thread { +struct worker_thread_t { struct worker_thread_group *worker_thread_group; pthread_mutex_t new_work_mutex; pthread_cond_t new_work_cond; @@ -65,10 +65,10 @@ struct worker_thread { struct thread_data thread_data; }; -static void *worker_thread (void *thread_data_in) { +static void *start_worker_thread (void *thread_data_in) { struct thread_data *thread_data = (struct thread_data *)thread_data_in; - struct worker_thread *worker_thread = - (struct worker_thread *)thread_data->data; + struct worker_thread_t *worker_thread = + (struct worker_thread_t *)thread_data->data; void *data_for_worker_fn; for (;;) { @@ -112,7 +112,7 @@ int worker_thread_group_init ( worker_thread_group->threadcount = threads; worker_thread_group->last_scheduled = 0; worker_thread_group->worker_fn = worker_fn; - worker_thread_group->threads = malloc (sizeof (struct worker_thread) * + worker_thread_group->threads = malloc (sizeof (struct worker_thread_t) * threads); if (worker_thread_group->threads == 0) { return (-1); @@ -139,7 +139,7 @@ int worker_thread_group_init ( worker_thread_group->threads[i].thread_state; worker_thread_group->threads[i].thread_data.data = &worker_thread_group->threads[i]; pthread_create (&worker_thread_group->threads[i].thread_id, - NULL, worker_thread, &worker_thread_group->threads[i].thread_data); + NULL, start_worker_thread, &worker_thread_group->threads[i].thread_data); } return (0); } @@ -201,7 +201,7 @@ void worker_thread_group_atsegv ( struct worker_thread_group *worker_thread_group) { void *data_for_worker_fn; - struct worker_thread *worker_thread; + struct worker_thread_t *worker_thread; unsigned int i; for (i = 0; i < worker_thread_group->threadcount; i++) { diff --git a/exec/wthread.h b/exec/wthread.h index 7301a257..374897e9 100644 --- a/exec/wthread.h +++ b/exec/wthread.h @@ -38,7 +38,7 @@ struct worker_thread_group { int threadcount; int last_scheduled; - struct worker_thread *threads; + struct worker_thread_t *threads; void (*worker_fn) (void *thread_state, void *work_item); };