_pthreadtypes.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1993, 1994 by Chris Provenzano, [email protected]
00003  * Copyright (c) 1995-1998 by John Birrell <[email protected]>
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  * 3. All advertising materials mentioning features or use of this software
00015  *    must display the following acknowledgement:
00016  *  This product includes software developed by Chris Provenzano.
00017  * 4. The name of Chris Provenzano may not be used to endorse or promote 
00018  *        products derived from this software without specific prior written
00019  *        permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
00022  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00023  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00024  * ARE DISCLAIMED.  IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY 
00025  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00026  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
00027  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00028  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
00029  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00030  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
00031  * SUCH DAMAGE.
00032  *
00033  * $FreeBSD: src/sys/sys/_pthreadtypes.h,v 1.1 2005/05/31 15:18:17 rodrigc Exp $
00034  */
00035 
00036 #ifndef _SYS__PTHREADTYPES_H_
00037 #define _SYS__PTHREADTYPES_H_
00038 
00039 /*
00040  * Forward structure definitions.
00041  *
00042  * These are mostly opaque to the user.
00043  */
00044 struct pthread;
00045 struct pthread_attr;
00046 struct pthread_cond;
00047 struct pthread_cond_attr;
00048 struct pthread_mutex;
00049 struct pthread_mutex_attr;
00050 struct pthread_once;
00051 struct pthread_rwlock;
00052 struct pthread_rwlockattr;
00053 struct pthread_barrier;
00054 struct pthread_barrier_attr;
00055 struct pthread_spinlock;
00056 
00057 /*
00058  * Primitive system data type definitions required by P1003.1c.
00059  *
00060  * Note that P1003.1c specifies that there are no defined comparison
00061  * or assignment operators for the types pthread_attr_t, pthread_cond_t,
00062  * pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t.
00063  */
00064 typedef struct  pthread                 *pthread_t;
00065 typedef struct  pthread_attr            *pthread_attr_t;
00066 typedef struct  pthread_mutex           *pthread_mutex_t;
00067 typedef struct  pthread_mutex_attr      *pthread_mutexattr_t;
00068 typedef struct  pthread_cond            *pthread_cond_t;
00069 typedef struct  pthread_cond_attr       *pthread_condattr_t;
00070 typedef int                             pthread_key_t;
00071 typedef struct  pthread_once            pthread_once_t;
00072 typedef struct  pthread_rwlock          *pthread_rwlock_t;
00073 typedef struct  pthread_rwlockattr      *pthread_rwlockattr_t;
00074 typedef struct  pthread_barrier         *pthread_barrier_t;
00075 typedef struct  pthread_barrierattr     *pthread_barrierattr_t;
00076 typedef struct  pthread_spinlock        *pthread_spinlock_t;
00077 
00078 /*
00079  * Additional type definitions:
00080  *
00081  * Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for
00082  * use in header symbols.
00083  */
00084 typedef void    *pthread_addr_t;
00085 typedef void    *(*pthread_startroutine_t)(void *);
00086 
00087 /*
00088  * Once definitions.
00089  */
00090 struct pthread_once {
00091         int             state;
00092         pthread_mutex_t mutex;
00093 };
00094 
00095 #endif /* ! _SYS__PTHREADTYPES_H_ */

Copyright © Nokia Corporation 2001-2008
Back to top