Path: blob/main/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.h
39586 views
/*1* CDDL HEADER START2*3* The contents of this file are subject to the terms of the4* Common Development and Distribution License (the "License").5* You may not use this file except in compliance with the License.6*7* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE8* or http://www.opensolaris.org/os/licensing.9* See the License for the specific language governing permissions10* and limitations under the License.11*12* When distributing Covered Code, include this CDDL HEADER in each13* file and include the License file at usr/src/OPENSOLARIS.LICENSE.14* If applicable, add the following below this CDDL HEADER, with the15* fields enclosed by brackets "[]" replaced with your own identifying16* information: Portions Copyright [yyyy] [name of copyright owner]17*18* CDDL HEADER END19*/20/*21* Copyright 2008 Sun Microsystems, Inc. All rights reserved.22* Use is subject to license terms.23*/2425#ifndef _CTFMERGE_H26#define _CTFMERGE_H2728#pragma ident "%Z%%M% %I% %E% SMI"2930/*31* Merging structures used in ctfmerge. See ctfmerge.c for locking semantics.32*/3334#include <pthread.h>3536#ifdef __cplusplus37extern "C" {38#endif3940#include "ctftools.h"41#include "barrier.h"42#include "fifo.h"4344typedef struct wip {45pthread_mutex_t wip_lock;46pthread_cond_t wip_cv;47tdata_t *wip_td;48int wip_nmerged;49int wip_batchid;50} wip_t;5152typedef struct workqueue {53int wq_next_batchid;5455int wq_maxbatchsz;5657wip_t *wq_wip;58int wq_nwipslots;59int wq_nthreads;60int wq_ithrottle;6162pthread_mutex_t wq_queue_lock;63fifo_t *wq_queue;64pthread_cond_t wq_work_avail;65pthread_cond_t wq_work_removed;66int wq_ninqueue;67int wq_nextpownum;6869pthread_mutex_t wq_donequeue_lock;70fifo_t *wq_donequeue;71int wq_lastdonebatch;72pthread_cond_t wq_done_cv;7374pthread_cond_t wq_alldone_cv; /* protected by queue_lock */75int wq_alldone;7677int wq_nomorefiles;7879pthread_t *wq_thread;8081barrier_t wq_bar1;82barrier_t wq_bar2;83} workqueue_t;8485#ifdef __cplusplus86}87#endif8889#endif /* _CTFMERGE_H */909192