1f08c3bdfSopenharmony_ci/* 2f08c3bdfSopenharmony_ci * 3f08c3bdfSopenharmony_ci * Copyright (c) International Business Machines Corp., 2001 4f08c3bdfSopenharmony_ci * 5f08c3bdfSopenharmony_ci * This program is free software; you can redistribute it and/or modify 6f08c3bdfSopenharmony_ci * it under the terms of the GNU General Public License as published by 7f08c3bdfSopenharmony_ci * the Free Software Foundation; either version 2 of the License, or 8f08c3bdfSopenharmony_ci * (at your option) any later version. 9f08c3bdfSopenharmony_ci * 10f08c3bdfSopenharmony_ci * This program is distributed in the hope that it will be useful, 11f08c3bdfSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 12f08c3bdfSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 13f08c3bdfSopenharmony_ci * the GNU General Public License for more details. 14f08c3bdfSopenharmony_ci * 15f08c3bdfSopenharmony_ci * You should have received a copy of the GNU General Public License 16f08c3bdfSopenharmony_ci * along with this program; if not, write to the Free Software 17f08c3bdfSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18f08c3bdfSopenharmony_ci */ 19f08c3bdfSopenharmony_ci 20f08c3bdfSopenharmony_cistruct child_info { 21f08c3bdfSopenharmony_ci int index; /* our index into the array */ 22f08c3bdfSopenharmony_ci int status; /* return status of this thread */ 23f08c3bdfSopenharmony_ci int child_count; /* Count of children created */ 24f08c3bdfSopenharmony_ci int talk_count; /* Count of siblings that */ 25f08c3bdfSopenharmony_ci /* have talked to us */ 26f08c3bdfSopenharmony_ci pthread_t *threads; /* dynamic array of thread */ 27f08c3bdfSopenharmony_ci /* ids of children */ 28f08c3bdfSopenharmony_ci pthread_mutex_t talk_mutex; /* mutex for the talk_count */ 29f08c3bdfSopenharmony_ci pthread_mutex_t child_mutex; /* mutex for the child_count */ 30f08c3bdfSopenharmony_ci pthread_cond_t talk_condvar; /* condition variable for talk_count */ 31f08c3bdfSopenharmony_ci pthread_cond_t child_condvar; /* condition variable for child_count */ 32f08c3bdfSopenharmony_ci struct child_info **child_ptrs; /* dynamic array of ptrs */ 33f08c3bdfSopenharmony_ci /* to children */ 34f08c3bdfSopenharmony_ci} ; 35f08c3bdfSopenharmony_ci 36f08c3bdfSopenharmony_citypedef struct child_info c_info; 37