FreeBSD/contrib/gcclibs/libgomp/team.c
/* Create a new team data structure.  */
Create a new team data structure.
Create a new team data structure .
static struct gomp_team *
new_team (unsigned nthreads, struct gomp_work_share *work_share)
{
  struct gomp_team *team;
  size_t size;
  size = sizeof (*team) + nthreads * sizeof (team->ordered_release[0]);
  team = gomp_malloc (size);
  gomp_mutex_init (&team->work_share_lock);
  team->work_shares = gomp_malloc (4 * sizeof (struct gomp_work_share *));
  team->generation_mask = 3;
  team->oldest_live_gen = work_share == NULL;
  team->num_live_gen = work_share != NULL;
  team->work_shares[0] = work_share;
  team->nthreads = nthreads;
  gomp_barrier_init (&team->barrier, nthreads);
  gomp_sem_init (&team->master_release, 0);
  team->ordered_release[0] = &team->master_release;
  return team;
}
static struct gomp_team * new_team ( unsigned nthreads , struct gomp_work_share * work_share ) { struct gomp_team * team ; size_t size ; size = sizeof ( * team ) + nthreads * sizeof ( team -> ordered_release [ 0 ] ) ; team = gomp_malloc ( size ) ; gomp_mutex_init ( & team -> work_share_lock ) ; team -> work_shares = gomp_malloc ( 4 * sizeof ( struct gomp_work_share * ) ) ; team -> generation_mask = 3 ; team -> oldest_live_gen = work_share == NULL ; team -> num_live_gen = work_share != NULL ; team -> work_shares [ 0 ] = work_share ; team -> nthreads = nthreads ; gomp_barrier_init ( & team -> barrier , nthreads ) ; gomp_sem_init ( & team -> master_release , 0 ) ; team -> ordered_release [ 0 ] = & team -> master_release ; return team ; }
Create a new team data structure.
Create a new team data structure .