Sfoglia il codice sorgente

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
Jim Meyering 17 anni fa
parent
commit
abff1fc785
2 ha cambiato i file con 8 aggiunte e 8 eliminazioni
  1. 7 7
      exec/wthread.c
  2. 1 1
      exec/wthread.h

+ 7 - 7
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++) {

+ 1 - 1
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);
 };