8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / tools / ctf / cvt / ctfmerge.h
blobce40803d52a81ee01bb7716b161fa723d764fdb8
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _CTFMERGE_H
27 #define _CTFMERGE_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
32 * Merging structures used in ctfmerge. See ctfmerge.c for locking semantics.
35 #include <pthread.h>
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
41 #include "ctftools.h"
42 #include "barrier.h"
43 #include "fifo.h"
45 typedef struct wip {
46 pthread_mutex_t wip_lock;
47 pthread_cond_t wip_cv;
48 tdata_t *wip_td;
49 int wip_nmerged;
50 int wip_batchid;
51 } wip_t;
53 typedef struct workqueue {
54 int wq_next_batchid;
56 int wq_maxbatchsz;
58 wip_t *wq_wip;
59 int wq_nwipslots;
60 int wq_nthreads;
61 int wq_ithrottle;
63 pthread_mutex_t wq_queue_lock;
64 fifo_t *wq_queue;
65 pthread_cond_t wq_work_avail;
66 pthread_cond_t wq_work_removed;
67 int wq_ninqueue;
68 int wq_nextpownum;
70 pthread_mutex_t wq_donequeue_lock;
71 fifo_t *wq_donequeue;
72 int wq_lastdonebatch;
73 pthread_cond_t wq_done_cv;
75 pthread_cond_t wq_alldone_cv; /* protected by queue_lock */
76 int wq_alldone;
78 int wq_nomorefiles;
80 pthread_t *wq_thread;
82 barrier_t wq_bar1;
83 barrier_t wq_bar2;
84 } workqueue_t;
86 #ifdef __cplusplus
88 #endif
90 #endif /* _CTFMERGE_H */