8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / fm / fmd / common / fmd_thread.h
blobd28cccc4bcd7aa150ef8800e52beee5e2e597485
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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _FMD_THREAD_H
26 #define _FMD_THREAD_H
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
32 #include <fmd_list.h>
33 #include <fmd_trace.h>
35 struct fmd_module; /* see <fmd_module.h> */
37 typedef void fmd_thread_f(void *); /* signature of thread startup func */
39 typedef struct fmd_thread {
40 fmd_list_t thr_list; /* linked-list next/prev pointers */
41 struct fmd_module *thr_mod; /* module associated with this thread */
42 pthread_t thr_tid; /* thread identifier */
43 fmd_thread_f *thr_func; /* thread startup function */
44 void *thr_arg; /* argument for startup function */
45 fmd_tracebuf_t *thr_trdata; /* thread trace buffer */
46 fmd_tracebuf_f *thr_trfunc; /* thread trace function */
47 uint_t thr_errdepth; /* fmd_verror() nesting depth */
48 int thr_isdoor; /* a private door server thread */
49 } fmd_thread_t;
51 extern fmd_thread_t *fmd_thread_xcreate(struct fmd_module *, pthread_t);
52 extern fmd_thread_t *fmd_thread_create(struct fmd_module *,
53 fmd_thread_f *, void *);
54 extern fmd_thread_t *fmd_doorthread_create(struct fmd_module *,
55 fmd_thread_f *, void *);
57 #define FMD_THREAD_NOJOIN 0 /* do not attempt to join with thread */
58 #define FMD_THREAD_JOIN 1 /* wait for and join with thread */
60 extern void fmd_thread_destroy(fmd_thread_t *, int);
62 #ifdef __cplusplus
64 #endif
66 #endif /* _FMD_THREAD_H */