12490Sjkh/* 22490Sjkh * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu 32490Sjkh * Copyright (c) 1995-1998 by John Birrell <jb@cimlogic.com.au> 42490Sjkh * All rights reserved. 52490Sjkh * 62490Sjkh * Redistribution and use in source and binary forms, with or without 72490Sjkh * modification, are permitted provided that the following conditions 82490Sjkh * are met: 92490Sjkh * 1. Redistributions of source code must retain the above copyright 102490Sjkh * notice, this list of conditions and the following disclaimer. 112490Sjkh * 2. Redistributions in binary form must reproduce the above copyright 122490Sjkh * notice, this list of conditions and the following disclaimer in the 132490Sjkh * documentation and/or other materials provided with the distribution. 142490Sjkh * 3. All advertising materials mentioning features or use of this software 152490Sjkh * must display the following acknowledgement: 162490Sjkh * This product includes software developed by Chris Provenzano. 172490Sjkh * 4. The name of Chris Provenzano may not be used to endorse or promote 182490Sjkh * products derived from this software without specific prior written 192490Sjkh * permission. 202490Sjkh * 212490Sjkh * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND 222490Sjkh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 232490Sjkh * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 242490Sjkh * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY 252490Sjkh * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 262490Sjkh * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 272490Sjkh * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 282490Sjkh * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 292490Sjkh * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 302490Sjkh * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 312490Sjkh * SUCH DAMAGE. 322490Sjkh * 332490Sjkh * $FreeBSD: releng/11.0/sys/sys/_pthreadtypes.h 189828 2009-03-14 20:10:14Z das $ 342490Sjkh */ 352490Sjkh 362490Sjkh#ifndef _SYS__PTHREADTYPES_H_ 372490Sjkh#define _SYS__PTHREADTYPES_H_ 382490Sjkh 392490Sjkh/* 4015944Sache * Forward structure definitions. 412490Sjkh * 422490Sjkh * These are mostly opaque to the user. 432490Sjkh */ 442490Sjkhstruct pthread; 452490Sjkhstruct pthread_attr; 462490Sjkhstruct pthread_cond; 472490Sjkhstruct pthread_cond_attr; 482490Sjkhstruct pthread_mutex; 492490Sjkhstruct pthread_mutex_attr; 502490Sjkhstruct pthread_once; 512490Sjkhstruct pthread_rwlock; 522490Sjkhstruct pthread_rwlockattr; 532490Sjkhstruct pthread_barrier; 542490Sjkhstruct pthread_barrier_attr; 55struct pthread_spinlock; 56 57/* 58 * Primitive system data type definitions required by P1003.1c. 59 * 60 * Note that P1003.1c specifies that there are no defined comparison 61 * or assignment operators for the types pthread_attr_t, pthread_cond_t, 62 * pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t. 63 */ 64#ifndef _PTHREAD_T_DECLARED 65typedef struct pthread *pthread_t; 66#define _PTHREAD_T_DECLARED 67#endif 68typedef struct pthread_attr *pthread_attr_t; 69typedef struct pthread_mutex *pthread_mutex_t; 70typedef struct pthread_mutex_attr *pthread_mutexattr_t; 71typedef struct pthread_cond *pthread_cond_t; 72typedef struct pthread_cond_attr *pthread_condattr_t; 73typedef int pthread_key_t; 74typedef struct pthread_once pthread_once_t; 75typedef struct pthread_rwlock *pthread_rwlock_t; 76typedef struct pthread_rwlockattr *pthread_rwlockattr_t; 77typedef struct pthread_barrier *pthread_barrier_t; 78typedef struct pthread_barrierattr *pthread_barrierattr_t; 79typedef struct pthread_spinlock *pthread_spinlock_t; 80 81/* 82 * Additional type definitions: 83 * 84 * Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for 85 * use in header symbols. 86 */ 87typedef void *pthread_addr_t; 88typedef void *(*pthread_startroutine_t)(void *); 89 90/* 91 * Once definitions. 92 */ 93struct pthread_once { 94 int state; 95 pthread_mutex_t mutex; 96}; 97 98#endif /* ! _SYS__PTHREADTYPES_H_ */ 99