void gomp_team_end (void) { struct gomp_thread *thr = gomp_thread (); struct gomp_team *team = thr->ts.team; gomp_barrier_wait (&team->barrier); thr->ts = team->prev_ts; free_team (team); }
/** Free the memory occupied by a teams array. @param teams The pointer to the array we free. */ void free_teams_array(GArray **teams, gboolean reset) { #ifdef DEBUG printf("free_teams_array\n"); #endif gint i; if(*teams == NULL) { if(reset) *teams = g_array_new(FALSE, FALSE, sizeof(Team)); return; } for(i=0; i<(*teams)->len; i++) free_team(&g_array_index(*teams, Team, i)); free_g_array(teams); if(reset) *teams = g_array_new(FALSE, FALSE, sizeof(Team)); }
/** Free a job struct. @param free_team Whether to free the team associated with the job if it's an international offer. */ void free_job(Job *job, gboolean free_tm) { #ifdef DEBUG printf("free_job\n"); #endif gint i; if(job->type == JOB_TYPE_INTERNATIONAL) { free_gchar_ptr(job->country_file); free_gchar_ptr(job->country_name); free_gchar_ptr(job->league_name); for(i=0; i<job_teams->len; i++) if(g_array_index(job_teams, Team, i).id == job->team_id) { if(free_tm) free_team(&g_array_index(job_teams, Team, i)); g_array_remove_index(job_teams, i); } } }