head 1.72; access; symbols PTH_2_0_7:1.71 PTH_2_0_6:1.70 PTH_2_0_5:1.70 PTH_2_0_4:1.70 PTH_2_0_3:1.69 PTH_2_0_2:1.69 PTH_2_0_1:1.68 PTH_2_0_0:1.67 PTH_2_0b2:1.66 PTH_2_0b1:1.65 PTH_2_0b0:1.65 PTH_1_4:1.61.0.2 PTH_1_4_1:1.61 PTH_1_4_0:1.60 PTH_1_3_7:1.52.2.1 PTH_1_4a3:1.53 PTH_1_3_6:1.52.2.1 PTH_1_4a2:1.53 PTH_1_3_5:1.52.2.1 PTH_1_4a1:1.53 PTH_1_3_4:1.52.2.1 PTH_1_3:1.52.0.2 PTH_1_3_3:1.52 PTH_1_3_2:1.52 PTH_1_3_1:1.51 PTH_1_3_0:1.51 PTH_1_3b3:1.51 PTH_1_2_3:1.47.2.1 PTH_1_3b2:1.51 PTH_1_3b1:1.51 PTH_1_3a5:1.51 PTH_1_3a4:1.51 PTH_1_3a3:1.51 PTH_1_2_2:1.47.2.1 PTH_1_3a2:1.51 PTH_1_2_1:1.47.2.1 PTH_1_3a1:1.48 PTH_1_2:1.47.0.2 PTH_1_2_0:1.47 PTH_1_2b8:1.46 PTH_1_2b7:1.45 PTH_1_1_6:1.41.2.1 PTH_1_2b6:1.44 PTH_1_2b5:1.44 PTH_1_2b4:1.44 PTH_1_2b3:1.44 PTH_1_2b2:1.42 PTH_1_2b1:1.42 PTH_1_1_5:1.41 PTH_1_0_6:1.28 PTH_1_0_5:1.28 PTH_1_0:1.28.0.2 PTH_1_1:1.41.0.2 PTH_1_1_4:1.41 PTH_1_1_3:1.36 PTH_1_1_2:1.36 PTH_1_1_1:1.36 PTH_1_1_0:1.35 PTH_1_1b7:1.33 PTH_1_1b6:1.33 PTH_1_1b5:1.33 PTH_1_1b4:1.32 PTH_1_1b3:1.30 PTH_1_1b2:1.28 PTH_1_1b1:1.28 PTH_1_0_4:1.28 PTH_1_0_3:1.28 PTH_1_0_2:1.26 PTH_1_0_1:1.25 PTH_1_0_0:1.23 PTH_1_0b8:1.21 PTH_1_0b7:1.16 PTH_1_0b6:1.15 PTH_1_0b5:1.14 PTH_1_0b4:1.7 PTH_1_0b3:1.3 PTH_1_0b2:1.2; locks; strict; comment @# @; 1.72 date 2007.01.01.18.23.53; author rse; state Exp; branches; next 1.71; commitid 9DhdiirNzQPBIP0s; 1.71 date 2006.06.08.17.54.54; author rse; state Exp; branches; next 1.70; commitid x8N3mLVdQgkbdeAr; 1.70 date 2004.12.31.19.34.45; author rse; state Exp; branches; next 1.69; 1.69 date 2004.09.12.09.28.05; author rse; state Exp; branches; next 1.68; 1.68 date 2004.07.13.10.50.49; author rse; state Exp; branches; next 1.67; 1.67 date 2003.01.01.15.49.12; author rse; state Exp; branches; next 1.66; 1.66 date 2002.11.09.11.30.15; author rse; state Exp; branches; next 1.65; 1.65 date 2002.11.03.16.31.34; author rse; state Exp; branches; next 1.64; 1.64 date 2002.10.15.18.23.37; author rse; state Exp; branches; next 1.63; 1.63 date 2002.10.15.17.23.19; author rse; state Exp; branches; next 1.62; 1.62 date 2002.09.24.14.50.37; author rse; state Exp; branches; next 1.61; 1.61 date 2002.01.27.11.03.41; author rse; state Exp; branches; next 1.60; 1.60 date 2001.03.24.16.01.06; author rse; state Exp; branches; next 1.59; 1.59 date 2001.03.24.15.55.33; author rse; state Exp; branches; next 1.58; 1.58 date 2001.03.24.15.46.32; author rse; state Exp; branches; next 1.57; 1.57 date 2001.03.24.14.51.05; author rse; state Exp; branches; next 1.56; 1.56 date 2001.03.24.14.37.06; author rse; state Exp; branches; next 1.55; 1.55 date 2001.03.24.14.27.29; author rse; state Exp; branches; next 1.54; 1.54 date 2001.01.01.12.51.08; author rse; state Exp; branches; next 1.53; 1.53 date 2000.03.27.17.03.25; author rse; state Exp; branches; next 1.52; 1.52 date 2000.02.23.12.44.08; author rse; state Exp; branches 1.52.2.1; next 1.51; 1.51 date 99.12.30.21.59.01; author rse; state Exp; branches; next 1.50; 1.50 date 99.12.24.17.56.49; author rse; state Exp; branches; next 1.49; 1.49 date 99.11.09.08.11.32; author rse; state Exp; branches; next 1.48; 1.48 date 99.11.01.10.27.21; author rse; state Exp; branches; next 1.47; 1.47 date 99.10.31.11.46.13; author rse; state Exp; branches 1.47.2.1; next 1.46; 1.46 date 99.10.26.13.06.47; author rse; state Exp; branches; next 1.45; 1.45 date 99.10.19.14.40.25; author rse; state Exp; branches; next 1.44; 1.44 date 99.09.17.08.01.56; author rse; state Exp; branches; next 1.43; 1.43 date 99.09.15.11.12.21; author rse; state Exp; branches; next 1.42; 1.42 date 99.08.31.11.24.58; author rse; state Exp; branches; next 1.41; 1.41 date 99.08.30.13.43.13; author rse; state Exp; branches 1.41.2.1; next 1.40; 1.40 date 99.08.29.16.49.30; author rse; state Exp; branches; next 1.39; 1.39 date 99.08.29.16.43.32; author rse; state Exp; branches; next 1.38; 1.38 date 99.08.29.16.18.06; author rse; state Exp; branches; next 1.37; 1.37 date 99.08.29.11.35.55; author rse; state Exp; branches; next 1.36; 1.36 date 99.08.21.12.16.14; author rse; state Exp; branches; next 1.35; 1.35 date 99.08.19.15.24.09; author rse; state Exp; branches; next 1.34; 1.34 date 99.08.19.15.08.53; author rse; state Exp; branches; next 1.33; 1.33 date 99.08.17.08.08.36; author rse; state Exp; branches; next 1.32; 1.32 date 99.08.13.15.54.29; author rse; state Exp; branches; next 1.31; 1.31 date 99.08.13.13.35.06; author rse; state Exp; branches; next 1.30; 1.30 date 99.08.11.09.55.13; author rse; state Exp; branches; next 1.29; 1.29 date 99.08.11.09.05.38; author rse; state Exp; branches; next 1.28; 1.28 date 99.07.30.07.13.59; author rse; state Exp; branches; next 1.27; 1.27 date 99.07.30.06.19.42; author rse; state Exp; branches; next 1.26; 1.26 date 99.07.23.16.27.37; author rse; state Exp; branches; next 1.25; 1.25 date 99.07.22.14.55.10; author rse; state Exp; branches; next 1.24; 1.24 date 99.07.19.06.09.47; author rse; state Exp; branches; next 1.23; 1.23 date 99.07.16.11.40.11; author rse; state Exp; branches; next 1.22; 1.22 date 99.07.16.09.57.11; author rse; state Exp; branches; next 1.21; 1.21 date 99.07.15.15.04.57; author rse; state Exp; branches; next 1.20; 1.20 date 99.07.15.14.06.32; author rse; state Exp; branches; next 1.19; 1.19 date 99.07.15.13.59.35; author rse; state Exp; branches; next 1.18; 1.18 date 99.07.15.13.52.49; author rse; state Exp; branches; next 1.17; 1.17 date 99.07.15.09.47.23; author rse; state Exp; branches; next 1.16; 1.16 date 99.07.14.18.53.14; author rse; state Exp; branches; next 1.15; 1.15 date 99.07.14.06.13.24; author rse; state Exp; branches; next 1.14; 1.14 date 99.07.10.15.32.56; author rse; state Exp; branches; next 1.13; 1.13 date 99.07.10.15.21.36; author rse; state Exp; branches; next 1.12; 1.12 date 99.07.10.15.14.47; author rse; state Exp; branches; next 1.11; 1.11 date 99.07.10.14.21.18; author rse; state Exp; branches; next 1.10; 1.10 date 99.07.09.08.06.41; author rse; state Exp; branches; next 1.9; 1.9 date 99.07.08.15.01.18; author rse; state Exp; branches; next 1.8; 1.8 date 99.07.08.12.23.21; author rse; state Exp; branches; next 1.7; 1.7 date 99.07.08.10.22.34; author rse; state Exp; branches; next 1.6; 1.6 date 99.07.08.10.19.12; author rse; state Exp; branches; next 1.5; 1.5 date 99.07.08.10.07.31; author rse; state Exp; branches; next 1.4; 1.4 date 99.07.08.09.41.00; author rse; state Exp; branches; next 1.3; 1.3 date 99.07.07.19.01.36; author rse; state Exp; branches; next 1.2; 1.2 date 99.07.04.13.36.38; author rse; state Exp; branches; next 1.1; 1.1 date 99.07.04.12.17.32; author rse; state Exp; branches; next ; 1.52.2.1 date 2000.03.27.17.04.17; author rse; state Exp; branches; next ; 1.47.2.1 date 99.11.01.10.25.02; author rse; state Exp; branches; next ; 1.41.2.1 date 99.09.24.21.52.52; author rse; state Exp; branches; next ; desc @@ 1.72 log @Adjusted all copyright messages for new year 2007. @ text @/* ** GNU Pth - The GNU Portable Threads ** Copyright (c) 1999-2007 Ralf S. Engelschall ** ** This file is part of GNU Pth, a non-preemptive thread scheduling ** library which can be found at http://www.gnu.org/software/pth/. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ** USA, or contact Ralf S. Engelschall . ** ** pthread.h: POSIX Thread ("Pthread") API for Pth */ /* ``Only those who attempt the absurd can achieve the impossible.'' -- Unknown */ #ifndef _PTH_PTHREAD_H_ #define _PTH_PTHREAD_H_ /* ** ** BOOTSTRAPPING ** */ /* * Prevent system includes from implicitly including * possibly existing vendor Pthread headers */ #define PTHREAD #define PTHREAD_H #define _PTHREAD_T #define _PTHREAD_H #define _PTHREAD_H_ #define PTHREAD_INCLUDED #define _PTHREAD_INCLUDED #define SYS_PTHREAD_H #define _SYS_PTHREAD_H #define _SYS_PTHREAD_H_ #define SYS_PTHREAD_INCLUDED #define _SYS_PTHREAD_INCLUDED #define BITS_PTHREADTYPES_H #define _BITS_PTHREADTYPES_H #define _BITS_PTHREADTYPES_H_ #define _BITS_SIGTHREAD_H /* * Special adjustments */ #if defined(__hpux) #define _PTHREADS_DRAFT4 #endif /* * Check if the user requests a bigger FD_SETSIZE than we can handle */ #if defined(FD_SETSIZE) #if FD_SETSIZE > @@PTH_FDSETSIZE@@ #error "FD_SETSIZE is larger than what GNU Pth can handle." #endif #endif /* * Protect namespace, because possibly existing vendor Pthread stuff * would certainly conflict with our defintions of pthread*_t. */ #define pthread_t __vendor_pthread_t #define pthread_attr_t __vendor_pthread_attr_t #define pthread_key_t __vendor_pthread_key_t #define pthread_once_t __vendor_pthread_once_t #define pthread_mutex_t __vendor_pthread_mutex_t #define pthread_mutexattr_t __vendor_pthread_mutexattr_t #define pthread_cond_t __vendor_pthread_cond_t #define pthread_condattr_t __vendor_pthread_condattr_t #define pthread_rwlock_t __vendor_pthread_rwlock_t #define pthread_rwlockattr_t __vendor_pthread_rwlockattr_t #define sched_param __vendor_sched_param /* * Allow structs containing pthread*_t in vendor headers * to have some type definitions */ #if 0 typedef int __vendor_pthread_t; typedef int __vendor_pthread_attr_t; typedef int __vendor_pthread_key_t; typedef int __vendor_pthread_once_t; typedef int __vendor_pthread_mutex_t; typedef int __vendor_pthread_mutexattr_t; typedef int __vendor_pthread_cond_t; typedef int __vendor_pthread_condattr_t; typedef int __vendor_pthread_rwlock_t; typedef int __vendor_pthread_rwlockattr_t; typedef int __vendor_sched_param; #endif /* * Include essential vendor headers */ #include /* for ssize_t */ #include /* for struct timeval */ #include /* for sockaddr */ #include /* for sigset_t */ #include /* for struct timespec */ #include /* for off_t */ @@EXTRA_INCLUDE_SYS_SELECT_H@@ /* * Unprotect namespace, so we can define our own variants now */ #undef pthread_t #undef pthread_attr_t #undef pthread_key_t #undef pthread_once_t #undef pthread_mutex_t #undef pthread_mutexattr_t #undef pthread_cond_t #undef pthread_condattr_t #undef pthread_rwlock_t #undef pthread_rwlockattr_t #undef sched_param /* * Cleanup more Pthread namespace from vendor values */ #undef _POSIX_THREADS #undef _POSIX_THREAD_ATTR_STACKADDR #undef _POSIX_THREAD_ATTR_STACKSIZE #undef _POSIX_THREAD_PRIORITY_SCHEDULING #undef _POSIX_THREAD_PRIO_INHERIT #undef _POSIX_THREAD_PRIO_PROTECT #undef _POSIX_THREAD_PROCESS_SHARED #undef _POSIX_THREAD_SAFE_FUNCTIONS #undef PTHREAD_DESTRUCTOR_ITERATIONS #undef PTHREAD_KEYS_MAX #undef PTHREAD_STACK_MIN #undef PTHREAD_THREADS_MAX #undef PTHREAD_CREATE_DETACHED #undef PTHREAD_CREATE_JOINABLE #undef PTHREAD_SCOPE_SYSTEM #undef PTHREAD_SCOPE_PROCESS #undef PTHREAD_INHERIT_SCHED #undef PTHREAD_EXPLICIT_SCHED #undef PTHREAD_CANCEL_ENABLE #undef PTHREAD_CANCEL_DISABLE #undef PTHREAD_CANCEL_ASYNCHRONOUS #undef PTHREAD_CANCEL_DEFERRED #undef PTHREAD_CANCELED #undef PTHREAD_PROCESS_PRIVATE #undef PTHREAD_PROCESS_SHARED #undef PTHREAD_ONCE_INIT #undef PTHREAD_MUTEX_DEFAULT #undef PTHREAD_MUTEX_RECURSIVE #undef PTHREAD_MUTEX_NORMAL #undef PTHREAD_MUTEX_ERRORCHECK #undef PTHREAD_MUTEX_INITIALIZER #undef PTHREAD_COND_INITIALIZER #undef PTHREAD_RWLOCK_INITIALIZER /* * Cleanup special adjustments */ #if defined(__hpux) #undef _PTHREADS_DRAFT4 #endif /* ** ** API DEFINITION ** */ #ifdef __cplusplus extern "C" { #endif /* * Fallbacks for essential typedefs */ @@FALLBACK_PID_T@@ @@FALLBACK_SIZE_T@@ @@FALLBACK_SSIZE_T@@ @@FALLBACK_SOCKLEN_T@@ @@FALLBACK_OFF_T@@ @@FALLBACK_NFDS_T@@ /* * Extra structure definitions */ struct timeval; struct timespec; /* * GNU Pth indentification */ #define _POSIX_THREAD_IS_GNU_PTH @@PTH_VERSION_HEX@@ /* * Compile time symbolic feature macros for portability * specification to applications using pthreads */ #define _POSIX_THREADS #define _POSIX_THREAD_ATTR_STACKADDR #define _POSIX_THREAD_ATTR_STACKSIZE #undef _POSIX_THREAD_PRIORITY_SCHEDULING #undef _POSIX_THREAD_PRIO_INHERIT #undef _POSIX_THREAD_PRIO_PROTECT #undef _POSIX_THREAD_PROCESS_SHARED #undef _POSIX_THREAD_SAFE_FUNCTIONS /* * System call mapping support type * (soft variant can be overridden) */ #define _POSIX_THREAD_SYSCALL_HARD @@PTH_SYSCALL_HARD@@ #ifndef _POSIX_THREAD_SYSCALL_SOFT #define _POSIX_THREAD_SYSCALL_SOFT @@PTH_SYSCALL_SOFT@@ #endif /* * Run-time invariant values */ #define PTHREAD_DESTRUCTOR_ITERATIONS 4 #define PTHREAD_KEYS_MAX 256 #define PTHREAD_STACK_MIN 8192 #define PTHREAD_THREADS_MAX 10000 /* actually yet no restriction */ /* * Flags for threads and thread attributes. */ #define PTHREAD_CREATE_DETACHED 0x01 #define PTHREAD_CREATE_JOINABLE 0x02 #define PTHREAD_SCOPE_SYSTEM 0x03 #define PTHREAD_SCOPE_PROCESS 0x04 #define PTHREAD_INHERIT_SCHED 0x05 #define PTHREAD_EXPLICIT_SCHED 0x06 /* * Values for cancellation */ #define PTHREAD_CANCEL_ENABLE 0x01 #define PTHREAD_CANCEL_DISABLE 0x02 #define PTHREAD_CANCEL_ASYNCHRONOUS 0x01 #define PTHREAD_CANCEL_DEFERRED 0x02 #define PTHREAD_CANCELED ((void *)-1) /* * Flags for mutex priority attributes */ #define PTHREAD_PRIO_INHERIT 0x00 #define PTHREAD_PRIO_NONE 0x01 #define PTHREAD_PRIO_PROTECT 0x02 /* * Flags for read/write lock attributes */ #define PTHREAD_PROCESS_PRIVATE 0x00 #define PTHREAD_PROCESS_SHARED 0x01 /* * Forward structure definitions. * These are mostly opaque to the application. */ struct pthread_st; struct pthread_attr_st; struct pthread_cond_st; struct pthread_mutex_st; struct pthread_rwlock_st; struct sched_param; /* * Primitive system data type definitions required by P1003.1c */ typedef struct pthread_st *pthread_t; typedef struct pthread_attr_st *pthread_attr_t; typedef int pthread_key_t; typedef int pthread_once_t; typedef int pthread_mutexattr_t; typedef struct pthread_mutex_st *pthread_mutex_t; typedef int pthread_condattr_t; typedef struct pthread_cond_st *pthread_cond_t; typedef int pthread_rwlockattr_t; typedef struct pthread_rwlock_st *pthread_rwlock_t; /* * Once support. */ #define PTHREAD_ONCE_INIT 0 /* * Mutex static initialization values. */ enum pthread_mutextype { PTHREAD_MUTEX_DEFAULT = 1, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK }; /* * Mutex/CondVar/RWLock static initialization values. */ #define PTHREAD_MUTEX_INITIALIZER (pthread_mutex_t)(NULL) #define PTHREAD_COND_INITIALIZER (pthread_cond_t)(NULL) #define PTHREAD_RWLOCK_INITIALIZER (pthread_rwlock_t)(NULL) /* * IEEE (``POSIX'') Std 1003.1 Second Edition 1996-07-12 */ /* thread attribute routines */ extern int pthread_attr_init(pthread_attr_t *); extern int pthread_attr_destroy(pthread_attr_t *); extern int pthread_attr_setinheritsched(pthread_attr_t *, int); extern int pthread_attr_getinheritsched(const pthread_attr_t *, int *); extern int pthread_attr_setschedparam(pthread_attr_t *, const struct sched_param *); extern int pthread_attr_getschedparam(const pthread_attr_t *, struct sched_param *); extern int pthread_attr_setschedpolicy(pthread_attr_t *, int); extern int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); extern int pthread_attr_setscope(pthread_attr_t *, int); extern int pthread_attr_getscope(const pthread_attr_t *, int *); extern int pthread_attr_setstacksize(pthread_attr_t *, size_t); extern int pthread_attr_getstacksize(const pthread_attr_t *, size_t *); extern int pthread_attr_setstackaddr(pthread_attr_t *, void *); extern int pthread_attr_getstackaddr(const pthread_attr_t *, void **); extern int pthread_attr_setdetachstate(pthread_attr_t *, int); extern int pthread_attr_getdetachstate(const pthread_attr_t *, int *); extern int pthread_attr_setguardsize(pthread_attr_t *, int); extern int pthread_attr_getguardsize(const pthread_attr_t *, int *); extern int pthread_attr_setname_np(pthread_attr_t *, char *); extern int pthread_attr_getname_np(const pthread_attr_t *, char **); extern int pthread_attr_setprio_np(pthread_attr_t *, int); extern int pthread_attr_getprio_np(const pthread_attr_t *, int *); /* thread routines */ extern int pthread_create(pthread_t *, const pthread_attr_t *, void *(*)(void *), void *); extern int __pthread_detach(pthread_t); #define pthread_detach(t) __pthread_detach(t) extern pthread_t pthread_self(void); extern int pthread_equal(pthread_t, pthread_t); extern int pthread_yield_np(void); extern void pthread_exit(void *); extern int pthread_join(pthread_t, void **); extern int pthread_once(pthread_once_t *, void (*)(void)); extern int pthread_sigmask(int, const sigset_t *, sigset_t *); extern int pthread_kill(pthread_t, int); /* concurrency routines */ extern int pthread_getconcurrency(void); extern int pthread_setconcurrency(int); /* context routines */ extern int pthread_key_create(pthread_key_t *, void (*)(void *)); extern int pthread_key_delete(pthread_key_t); extern int pthread_setspecific(pthread_key_t, const void *); extern void *pthread_getspecific(pthread_key_t); /* cancel routines */ extern int pthread_cancel(pthread_t); extern void pthread_testcancel(void); extern int pthread_setcancelstate(int, int *); extern int pthread_setcanceltype(int, int *); /* scheduler routines */ extern int pthread_setschedparam(pthread_t, int, const struct sched_param *); extern int pthread_getschedparam(pthread_t, int *, struct sched_param *); /* cleanup routines */ extern void pthread_cleanup_push(void (*)(void *), void *); extern void pthread_cleanup_pop(int); extern int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); /* mutex attribute routines */ extern int pthread_mutexattr_init(pthread_mutexattr_t *); extern int pthread_mutexattr_destroy(pthread_mutexattr_t *); extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int); extern int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *, int *); extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); extern int pthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *); extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); extern int pthread_mutexattr_getpshared(pthread_mutexattr_t *, int *); extern int pthread_mutexattr_settype(pthread_mutexattr_t *, int); extern int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); /* mutex routines */ extern int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *); extern int pthread_mutex_destroy(pthread_mutex_t *); extern int pthread_mutex_setprioceiling(pthread_mutex_t *, int, int *); extern int pthread_mutex_getprioceiling(pthread_mutex_t *, int *); extern int pthread_mutex_lock(pthread_mutex_t *); extern int pthread_mutex_trylock(pthread_mutex_t *); extern int pthread_mutex_unlock(pthread_mutex_t *); /* rwlock attribute routines */ extern int pthread_rwlockattr_init(pthread_rwlockattr_t *); extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, int *); /* rwlock routines */ extern int pthread_rwlock_init(pthread_rwlock_t *, const pthread_rwlockattr_t *); extern int pthread_rwlock_destroy(pthread_rwlock_t *); extern int pthread_rwlock_rdlock(pthread_rwlock_t *); extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *); extern int pthread_rwlock_wrlock(pthread_rwlock_t *); extern int pthread_rwlock_trywrlock(pthread_rwlock_t *); extern int pthread_rwlock_unlock(pthread_rwlock_t *); /* condition attribute routines */ extern int pthread_condattr_init(pthread_condattr_t *); extern int pthread_condattr_destroy(pthread_condattr_t *); extern int pthread_condattr_setpshared(pthread_condattr_t *, int); extern int pthread_condattr_getpshared(pthread_condattr_t *, int *); /* condition routines */ extern int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); extern int pthread_cond_destroy(pthread_cond_t *); extern int pthread_cond_broadcast(pthread_cond_t *); extern int pthread_cond_signal(pthread_cond_t *); extern int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); extern int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *, const struct timespec *); /* * Extensions created by POSIX 1003.1j */ extern int pthread_abort(pthread_t); /* * Optionally fake poll(2) data structure and options */ #if !(@@PTH_FAKE_POLL@@) /* use vendor poll(2) environment */ #include #ifndef INFTIM #define INFTIM (-1) #endif #else /* fake a poll(2) environment */ #define POLLIN 0x0001 /* any readable data available */ #define POLLPRI 0x0002 /* OOB/Urgent readable data */ #define POLLOUT 0x0004 /* file descriptor is writeable */ #define POLLERR 0x0008 /* some poll error occurred */ #define POLLHUP 0x0010 /* file descriptor was "hung up" */ #define POLLNVAL 0x0020 /* requested events "invalid" */ #define POLLRDNORM POLLIN #define POLLRDBAND POLLIN #define POLLWRNORM POLLOUT #define POLLWRBAND POLLOUT #ifndef INFTIM #define INFTIM (-1) /* poll infinite */ #endif struct pollfd { int fd; /* which file descriptor to poll */ short events; /* events we are interested in */ short revents; /* events found on return */ }; #endif /* * Optionally fake readv(2)/writev(2) data structure and options */ #if !(@@PTH_FAKE_RWV@@) /* use vendor readv(2)/writev(2) environment */ #include #ifndef UIO_MAXIOV #define UIO_MAXIOV 1024 #endif #else /* fake a readv(2)/writev(2) environment */ struct iovec { void *iov_base; /* memory base address */ size_t iov_len; /* memory chunk length */ }; #ifndef UIO_MAXIOV #define UIO_MAXIOV 1024 #endif #endif /* * Replacement Functions (threading aware) */ extern pid_t __pthread_fork(void); extern unsigned int __pthread_sleep(unsigned int); extern int __pthread_nanosleep(const struct timespec *, struct timespec *); extern int __pthread_usleep(unsigned int); extern int __pthread_system(const char *); extern int __pthread_sigwait(const sigset_t *, int *); extern pid_t __pthread_waitpid(pid_t, int *, int); extern int __pthread_connect(int, struct sockaddr *, socklen_t); extern int __pthread_accept(int, struct sockaddr *, socklen_t *); extern int __pthread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *); extern int __pthread_poll(struct pollfd *, nfds_t, int); extern ssize_t __pthread_read(int, void *, size_t); extern ssize_t __pthread_write(int, const void *, size_t); extern ssize_t __pthread_readv(int, const struct iovec *, int); extern ssize_t __pthread_writev(int, const struct iovec *, int); extern ssize_t __pthread_recv(int, void *, size_t, int); extern ssize_t __pthread_send(int, const void *, size_t, int); extern ssize_t __pthread_recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); extern ssize_t __pthread_sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); extern ssize_t __pthread_pread(int, void *, size_t, off_t); extern ssize_t __pthread_pwrite(int, const void *, size_t, off_t); #if _POSIX_THREAD_SYSCALL_SOFT && !defined(_PTHREAD_PRIVATE) #define fork __pthread_fork #define sleep __pthread_sleep #define nanosleep __pthread_nanosleep #define usleep __pthread_usleep #define system __pthread_system #define sigwait __pthread_sigwait #define waitpid __pthread_waitpid #define connect __pthread_connect #define accept __pthread_accept #define select __pthread_select #define poll __pthread_poll #define read __pthread_read #define write __pthread_write #define readv __pthread_readv #define writev __pthread_writev #define recv __pthread_recv #define send __pthread_send #define recvfrom __pthread_recvfrom #define sendto __pthread_sendto #define pread __pthread_pread #define pwrite __pthread_pwrite #endif /* * More "special" POSIX stuff */ #define sched_yield pthread_yield_np /* * Backward Compatibility Stuff for Pthread draft 4 (DCE threads) */ #ifdef _POSIX_BACKCOMPAT #define _POSIX_THREADS_PER_THREAD_SIGNALS 1 #define pthread_attr_default NULL #define pthread_condattr_default NULL #define pthread_mutexattr_default NULL #define pthread_once_init PTHREAD_ONCE_INIT #define pthread_detach(thread) __pthread_detach(*(thread)) #define pthread_attr_init pthread_attr_create #define pthread_attr_delete pthread_attr_destroy #define pthread_keycreate pthread_key_create #define pthread_yield pthread_yield_np #define pthread_attr_setprio pthread_attr_setprio_np #define pthread_attr_getprio pthread_attr_getprio_np #define CANCEL_ON 1 #define CANCEL_OFF 2 #define pthread_setcancel(what) \ pthread_setcancelstate((what) == CANCEL_ON ? \ PTHREAD_CANCEL_ENABLE : \ PTHREAD_CANCEL_DISABLE) #define pthread_setasynccancel(what) \ pthread_setcanceltype((what) == CANCEL_ON ? \ PTHREAD_CANCEL_ASYNCHRONOUS : \ PTHREAD_CANCEL_DEFERRED) #define pthread_setscheduler #error #define pthread_setprio #error #define pthread_attr_setsched #error #define pthread_attr_getsched #error #endif /* _POSIX_BACKCOMPAT */ #ifdef __cplusplus } #endif #endif /* _PTH_PTHREAD_H_ */ @ 1.71 log @Adjusted all copyright messages for new year 2006 @ text @d3 1 a3 1 ** Copyright (c) 1999-2006 Ralf S. Engelschall @ 1.70 log @Adjusted all copyright messages for new year 2005. @ text @d3 1 a3 1 ** Copyright (c) 1999-2005 Ralf S. Engelschall @ 1.69 log @Fixed prototype for pthread_attr_setschedparam(3) from to use a "const struct sched_param *" argument to comply with SUSv2/v3. Submitted by: Rafael Ávila de Espíndola @ text @d3 1 a3 1 ** Copyright (c) 1999-2004 Ralf S. Engelschall @ 1.68 log @Adjusted all copyright messages for new year 2004. @ text @d327 1 a327 1 extern int pthread_attr_setschedparam(pthread_attr_t *, struct sched_param *); @ 1.67 log @Adjusted all copyright messages for new year 2003. @ text @d3 1 a3 1 ** Copyright (c) 1999-2003 Ralf S. Engelschall @ 1.66 log @Added soft syscall mapping for nanosleep(3) and usleep(3) functions also to the Pthread API. @ text @d3 1 a3 1 ** Copyright (c) 1999-2002 Ralf S. Engelschall @ 1.65 log @Add Autoconf option --with-fdsetsize=NUM which allows to force a particular (usually higher than the default) FD_SETSIZE value for building Pth. Additionally Pth makes sure that the application using Pth does not use an even larger size. Original patch by: Nick Hudson @ text @d496 2 d519 2 @ 1.64 log @add a missing prototype for the new pthread_system wrapper @ text @d66 9 @ 1.63 log @The manual page stated that system(3) is supported in the "Soft System Call Mapping", but in fact it was forgotten in the implementation. Submitted by: Jonathan Schilling @ text @d487 1 @ 1.62 log @Add #define _PTHREAD_T to pthread.h to guard under SCO UnixWare 7 and OpenUNIX 8. Submitted by: Jonathan Schilling @ text @d507 1 @ 1.61 log @bump copyright year @ text @d43 1 @ 1.60 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2001 Ralf S. Engelschall @ 1.59 log @*** empty log message *** @ text @d249 7 @ 1.58 log @*** empty log message *** @ text @d342 4 @ 1.57 log @*** empty log message *** @ text @d309 1 a309 1 extern int pthread_attr_getinheritsched(pthread_attr_t *, int *); d311 1 a311 1 extern int pthread_attr_getschedparam(pthread_attr_t *, struct sched_param *); d313 1 a313 1 extern int pthread_attr_getschedpolicy(pthread_attr_t *, int *); d315 1 a315 1 extern int pthread_attr_getscope(pthread_attr_t *, int *); d317 1 a317 1 extern int pthread_attr_getstacksize(pthread_attr_t *, size_t *); d319 1 a319 1 extern int pthread_attr_getstackaddr(pthread_attr_t *, void **); d321 3 a323 1 extern int pthread_attr_getdetachstate(pthread_attr_t *, int *); d325 1 a325 1 extern int pthread_attr_getname_np(pthread_attr_t *, char **); d327 1 a327 1 extern int pthread_attr_getprio_np(pthread_attr_t *, int *); @ 1.56 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2000 Ralf S. Engelschall @ 1.55 log @*** empty log message *** @ text @d485 2 a486 2 extern ssize_t __pthread_recvfrom(int, void *, size_t, int, struct sockaddr *, int *); extern ssize_t __pthread_sendto(int, const void *, size_t, int, struct sockaddr *, int); @ 1.54 log @*** empty log message *** @ text @d227 1 a227 1 #define PTHREAD_THREADS_MAX 10000 /* actually now restriction */ d483 4 d503 4 @ 1.53 log @*** empty log message *** @ text @d55 1 @ 1.52 log @*** empty log message *** @ text @d106 1 @ 1.52.2.1 log @*** empty log message *** @ text @a105 1 @@EXTRA_INCLUDE_SYS_SELECT_H@@ @ 1.51 log @*** empty log message *** @ text @d57 7 d158 7 @ 1.50 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999 Ralf S. Engelschall @ 1.49 log @*** empty log message *** @ text @d52 3 @ 1.48 log @*** empty log message *** @ text @d38 1 a38 1 * Prevent system includes from implicitly including d70 1 a70 1 * Allow structs containing pthread*_t in vendor headers d100 11 a110 11 #undef pthread_t #undef pthread_attr_t #undef pthread_key_t #undef pthread_once_t #undef pthread_mutex_t #undef pthread_mutexattr_t #undef pthread_cond_t #undef pthread_condattr_t #undef pthread_rwlock_t #undef pthread_rwlockattr_t #undef sched_param d132 6 a137 6 #undef PTHREAD_EXPLICIT_SCHED #undef PTHREAD_CANCEL_ENABLE #undef PTHREAD_CANCEL_DISABLE #undef PTHREAD_CANCEL_ASYNCHRONOUS #undef PTHREAD_CANCEL_DEFERRED #undef PTHREAD_CANCELED d139 1 a139 1 #undef PTHREAD_PROCESS_SHARED d145 3 a147 3 #undef PTHREAD_MUTEX_INITIALIZER #undef PTHREAD_COND_INITIALIZER #undef PTHREAD_RWLOCK_INITIALIZER d159 2 a160 2 /* * Fallbacks for essential typedefs d169 1 a169 1 /* d193 2 a194 2 /* * System call mapping support type d223 1 a223 1 #define PTHREAD_CANCEL_ENABLE 0x01 d233 1 a233 1 #define PTHREAD_PROCESS_SHARED 0x01 d266 1 a266 1 * Mutex static initialization values. d276 1 a276 1 * Mutex/CondVar/RWLock static initialization values. d397 1 a397 1 /* d428 1 a428 1 /* @ 1.47 log @*** empty log message *** @ text @d2 1 a2 2 ** pthread.h -- POSIX Thread ("pthread") API for Pth ** d22 2 @ 1.47.2.1 log @*** empty log message *** @ text @d2 2 a3 1 ** GNU Pth - The GNU Portable Threads a22 2 ** ** pthread.h: POSIX Thread ("Pthread") API for Pth @ 1.46 log @*** empty log message *** @ text @d12 1 a12 1 ** version 2 of the License, or (at your option) any later version. @ 1.45 log @*** empty log message *** @ text @a398 1 #if !defined(_PTHREAD_PRIVATE) a425 3 #else struct pollfd; #endif a429 1 #if !defined(_PTHREAD_PRIVATE) a444 3 #endif #else struct iovec; @ 1.44 log @*** empty log message *** @ text @d166 1 d466 1 a466 1 extern int __pthread_poll(struct pollfd *, unsigned int, int); @ 1.43 log @*** empty log message *** @ text @d10 1 a10 1 ** modify it under the terms of the GNU Library General Public d17 1 a17 1 ** Library General Public License for more details. d19 1 a19 1 ** You should have received a copy of the GNU Library General Public @ 1.42 log @*** empty log message *** @ text @d40 1 @ 1.41 log @*** empty log message *** @ text @d163 1 d461 2 a462 2 extern int __pthread_connect(int, struct sockaddr *, int); extern int __pthread_accept(int, struct sockaddr *, int *); @ 1.41.2.1 log @*** empty log message *** @ text @a39 1 #define PTHREAD @ 1.40 log @*** empty log message *** @ text @d88 4 a91 4 #include /* for ssize_t */ #include /* for struct timeval */ #include /* for sockaddr */ #include /* for sigset_t */ d93 1 a93 1 #include /* for off_t */ d405 4 a408 4 #define POLLIN 0x0001 /* any readable data available */ #define POLLPRI 0x0002 /* OOB/Urgent readable data */ #define POLLOUT 0x0004 /* file descriptor is writeable */ #define POLLERR 0x0008 /* some poll error occurred */ d410 1 a410 1 #define POLLNVAL 0x0020 /* requested events "invalid" */ d420 2 a421 2 short events; /* events we are interested in */ short revents; /* events found on return */ @ 1.39 log @*** empty log message *** @ text @d306 2 a307 2 extern int pthread_detach_I(pthread_t); #define pthread_detach(t) pthread_detach_I(t) d507 1 a507 1 #define pthread_detach(thread) pthread_detach_I(&(thread)) @ 1.38 log @*** empty log message *** @ text @d456 14 a469 14 extern pid_t _pthread_fork(void); extern unsigned int _pthread_sleep(unsigned int); extern int _pthread_sigwait(const sigset_t *, int *); extern pid_t _pthread_waitpid(pid_t, int *, int); extern int _pthread_connect(int, struct sockaddr *, int); extern int _pthread_accept(int, struct sockaddr *, int *); extern int _pthread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *); extern int _pthread_poll(struct pollfd *, unsigned int, int); extern ssize_t _pthread_read(int, void *, size_t); extern ssize_t _pthread_write(int, const void *, size_t); extern ssize_t _pthread_readv(int, const struct iovec *, int); extern ssize_t _pthread_writev(int, const struct iovec *, int); extern ssize_t _pthread_pread(int, void *, size_t, off_t); extern ssize_t _pthread_pwrite(int, const void *, size_t, off_t); d472 14 a485 14 #define fork _pthread_fork #define sleep _pthread_sleep #define sigwait _pthread_sigwait #define waitpid _pthread_waitpid #define connect _pthread_connect #define accept _pthread_accept #define select _pthread_select #define poll _pthread_poll #define read _pthread_read #define write _pthread_write #define readv _pthread_readv #define writev _pthread_writev #define pread _pthread_pread #define pwrite _pthread_pwrite @ 1.37 log @*** empty log message *** @ text @d509 2 a510 1 #define pthread_delete pthread_attr_destroy @ 1.36 log @*** empty log message *** @ text @a278 9 * Default attribute arguments (POSIX draft 4, *deprecated*). */ #ifdef _POSIX_BACKCOMPAT #define pthread_attr_default NULL #define pthread_condattr_default NULL #define pthread_mutexattr_default NULL #endif /* d306 2 a307 1 extern int pthread_detach(pthread_t); d493 40 @ 1.35 log @*** empty log message *** @ text @d318 1 a318 1 extern void pthread_yield_np(void); @ 1.34 log @*** empty log message *** @ text @d71 1 d83 1 @ 1.33 log @*** empty log message *** @ text @d24 3 a26 1 @ 1.32 log @*** empty log message *** @ text @d231 5 a235 9 struct pthread; struct pthread_attr; struct pthread_cond; struct pthread_cond_attr; struct pthread_mutex; struct pthread_mutex_attr; struct pthread_once; struct pthread_rwlock; struct pthread_rwlockattr; d241 2 a242 2 typedef struct pthread *pthread_t; typedef struct pthread_attr *pthread_attr_t; d246 1 a246 1 typedef struct pthread_mutex *pthread_mutex_t; d248 1 a248 1 typedef struct pthread_cond *pthread_cond_t; d250 1 a250 1 typedef struct pthread_rwlock *pthread_rwlock_t; d288 20 a307 20 int pthread_attr_init(pthread_attr_t *); int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_setinheritsched(pthread_attr_t *, int); int pthread_attr_getinheritsched(pthread_attr_t *, int *); int pthread_attr_setschedparam(pthread_attr_t *, struct sched_param *); int pthread_attr_getschedparam(pthread_attr_t *, struct sched_param *); int pthread_attr_setschedpolicy(pthread_attr_t *, int); int pthread_attr_getschedpolicy(pthread_attr_t *, int *); int pthread_attr_setscope(pthread_attr_t *, int); int pthread_attr_getscope(pthread_attr_t *, int *); int pthread_attr_setstacksize(pthread_attr_t *, size_t); int pthread_attr_getstacksize(pthread_attr_t *, size_t *); int pthread_attr_setstackaddr(pthread_attr_t *, void *); int pthread_attr_getstackaddr(pthread_attr_t *, void **); int pthread_attr_setdetachstate(pthread_attr_t *, int); int pthread_attr_getdetachstate(pthread_attr_t *, int *); int pthread_attr_setname_np(pthread_attr_t *, char *); int pthread_attr_getname_np(pthread_attr_t *, char **); int pthread_attr_setprio_np(pthread_attr_t *, int); int pthread_attr_getprio_np(pthread_attr_t *, int *); d310 10 a319 10 int pthread_create(pthread_t *, const pthread_attr_t *, void *(*)(void *), void *); int pthread_detach(pthread_t); pthread_t pthread_self(void); int pthread_equal(pthread_t, pthread_t); void pthread_yield_np(void); void pthread_exit(void *); int pthread_join(pthread_t, void **); int pthread_once(pthread_once_t *, void (*)(void)); int pthread_sigmask(int, const sigset_t *, sigset_t *); int pthread_kill(pthread_t, int); d322 4 a325 4 int pthread_key_create(pthread_key_t *, void (*)(void *)); int pthread_key_delete(pthread_key_t); int pthread_setspecific(pthread_key_t, const void *); void *pthread_getspecific(pthread_key_t); d328 4 a331 4 int pthread_cancel(pthread_t); void pthread_testcancel(void); int pthread_setcancelstate(int, int *); int pthread_setcanceltype(int, int *); d334 2 a335 2 int pthread_setschedparam(pthread_t, int, const struct sched_param *); int pthread_getschedparam(pthread_t, int *, struct sched_param *); d338 3 a340 3 void pthread_cleanup_push(void (*)(void *), void *); void pthread_cleanup_pop(int); int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); d343 10 a352 10 int pthread_mutexattr_init(pthread_mutexattr_t *); int pthread_mutexattr_destroy(pthread_mutexattr_t *); int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int); int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *, int *); int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *); int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); int pthread_mutexattr_getpshared(pthread_mutexattr_t *, int *); int pthread_mutexattr_settype(pthread_mutexattr_t *, int); int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); d355 7 a361 7 int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *); int pthread_mutex_destroy(pthread_mutex_t *); int pthread_mutex_setprioceiling(pthread_mutex_t *, int, int *); int pthread_mutex_getprioceiling(pthread_mutex_t *, int *); int pthread_mutex_lock(pthread_mutex_t *); int pthread_mutex_trylock(pthread_mutex_t *); int pthread_mutex_unlock(pthread_mutex_t *); d364 4 a367 4 int pthread_rwlockattr_init(pthread_rwlockattr_t *); int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, int *); d370 7 a376 7 int pthread_rwlock_init(pthread_rwlock_t *, const pthread_rwlockattr_t *); int pthread_rwlock_destroy(pthread_rwlock_t *); int pthread_rwlock_rdlock(pthread_rwlock_t *); int pthread_rwlock_tryrdlock(pthread_rwlock_t *); int pthread_rwlock_wrlock(pthread_rwlock_t *); int pthread_rwlock_trywrlock(pthread_rwlock_t *); int pthread_rwlock_unlock(pthread_rwlock_t *); d379 4 a382 4 int pthread_condattr_init(pthread_condattr_t *); int pthread_condattr_destroy(pthread_condattr_t *); int pthread_condattr_setpshared(pthread_condattr_t *, int); int pthread_condattr_getpshared(pthread_condattr_t *, int *); d385 6 a390 6 int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); int pthread_cond_destroy(pthread_cond_t *); int pthread_cond_broadcast(pthread_cond_t *); int pthread_cond_signal(pthread_cond_t *); int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *, const struct timespec *); d395 1 a395 1 int pthread_abort(pthread_t); d457 1 a457 1 * Thread-Safe functions d460 14 a473 14 pid_t _pthread_fork(void); unsigned int _pthread_sleep(unsigned int); int _pthread_sigwait(const sigset_t *, int *); pid_t _pthread_waitpid(pid_t, int *, int); int _pthread_connect(int, struct sockaddr *, int); int _pthread_accept(int, struct sockaddr *, int *); int _pthread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *); int _pthread_poll(struct pollfd *, unsigned int, int); ssize_t _pthread_read(int, void *, size_t); ssize_t _pthread_write(int, const void *, size_t); ssize_t _pthread_readv(int, const struct iovec *, int); ssize_t _pthread_writev(int, const struct iovec *, int); ssize_t _pthread_pread(int, void *, size_t, off_t); ssize_t _pthread_pwrite(int, const void *, size_t, off_t); @ 1.31 log @*** empty log message *** @ text @d170 1 a170 4 #define _POSIX_THREAD_IS_GNU_PTH 1 #ifndef PTH_VERSION #define PTH_VERSION @@PTH_VERSION_HEX@@ #endif @ 1.30 log @*** empty log message *** @ text @d446 3 d455 3 @ 1.29 log @*** empty log message *** @ text @d66 16 @ 1.28 log @*** empty log message *** @ text @d25 15 a39 1 #ifndef _PTHREAD_H_ d41 23 d66 1 a66 1 * Essential header files a74 18 /* * Fallbacks for essential typedefs */ @@FALLBACK_PID_T@@ @@FALLBACK_SIZE_T@@ @@FALLBACK_SSIZE_T@@ @@FALLBACK_OFF_T@@ /* * Extra structure definitions */ struct timeval; struct timespec; #ifdef __cplusplus extern "C" { #endif d76 1 a76 1 * GNU Pth indentification d78 11 a88 4 #define _POSIX_THREAD_IS_GNU_PTH 1 #ifndef PTH_VERSION #define PTH_VERSION @@PTH_VERSION_HEX@@ #endif d91 1 a91 1 * Cleanup namespace from vendor stuff d93 8 a104 3 #undef _POSIX_THREADS #undef _POSIX_THREAD_ATTR_STACKADDR #undef _POSIX_THREAD_ATTR_STACKSIZE d111 25 d137 2 a138 2 /* * Values for cancellation d140 4 a143 5 #define PTHREAD_CANCEL_ENABLE 0x01 #define PTHREAD_CANCEL_DISABLE 0x02 #define PTHREAD_CANCEL_ASYNCHRONOUS 0x01 #define PTHREAD_CANCEL_DEFERRED 0x02 #define PTHREAD_CANCELED ((void *)-1) d145 2 a146 2 /* * Flags for read/write lock attributes d148 2 a149 2 #define PTHREAD_PROCESS_PRIVATE 0x00 #define PTHREAD_PROCESS_SHARED 0x01 d152 1 a152 1 * Run-time invariant values: d154 4 a157 4 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 #define PTHREAD_KEYS_MAX 256 #define PTHREAD_STACK_MIN 8192 #define PTHREAD_THREADS_MAX 10000 /* actually now restriction */ d172 4 a175 1 /* system call mapping support type (soft variant can be overridden) */ d182 8 d206 1 d216 1 a216 1 * These are mostly opaque to the user. d278 1 a278 1 /* thread attribute routines */ d300 1 a300 1 /* thread routines */ d312 1 a312 1 /* context routines */ d318 1 a318 1 /* cancel routines */ d324 1 a324 1 /* scheduler routines */ d328 1 a328 1 /* cleanup routines */ d333 1 a333 1 /* mutex attribute routines */ d345 1 a345 1 /* mutex routines */ d354 1 a354 1 /* rwlock attribute routines */ d360 1 a360 1 /* rwlock routines */ d369 1 a369 1 /* condition attribute routines */ d375 1 a375 1 /* condition routines */ a385 1 d419 2 d437 2 d460 1 a460 1 #if _POSIX_THREAD_SYSCALL_SOFT d487 1 a487 1 #endif /* _PTHREAD_H_ */ @ 1.27 log @*** empty log message *** @ text @d325 2 a326 1 #if !(@@PTH_FAKE_POLL@@) && !defined(_PTHREAD_PRIVATE) d353 1 d358 2 a359 1 #if !(@@PTH_FAKE_RWV@@) && !defined(_PTHREAD_PRIVATE) d368 1 @ 1.26 log @*** empty log message *** @ text @d32 1 a32 1 #include /* for struct timeval/timespec */ d35 1 d325 1 a325 1 #if !(@@PTH_FAKE_POLL@@) d350 14 @ 1.25 log @*** empty log message *** @ text @d2 1 a2 1 ** pthread.h -- POSIX Thread ("pthread") API for PTH @ 1.24 log @*** empty log message *** @ text @d35 1 a35 6 /* * Extra structure definitions */ struct timeval; struct timespec; d43 7 d366 2 d382 4 a392 2 #define pread _pthread_pread #define pwrite _pthread_pwrite @ 1.23 log @*** empty log message *** @ text @d29 1 a29 1 * Essential header files. d32 1 a32 1 #include /* for struct timeval */ d34 7 a40 2 #include #include d243 1 a243 1 int pthread_key_create(pthread_key_t *, void (*routine) (void *)); d273 1 a273 1 int pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *type); @ 1.22 log @*** empty log message *** @ text @a349 1 int _pthread_usleep(unsigned int); a363 1 /* #define usleep _pthread_usleep !! too unstandardized !! */ @ 1.21 log @*** empty log message *** @ text @d365 1 a365 3 #if 0 /* too unstandardized */ #define usleep _pthread_usleep #endif @ 1.20 log @*** empty log message *** @ text @a257 14 /* condition attribute routines */ int pthread_condattr_init(pthread_condattr_t *); int pthread_condattr_destroy(pthread_condattr_t *); int pthread_condattr_setpshared(pthread_condattr_t *, int); int pthread_condattr_getpshared(pthread_condattr_t *, int *); /* condition routines */ int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); int pthread_cond_destroy(pthread_cond_t *); int pthread_cond_broadcast(pthread_cond_t *); int pthread_cond_signal(pthread_cond_t *); int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *, const struct timespec *); d293 14 @ 1.19 log @*** empty log message *** @ text @d171 1 a171 1 #define PTHREAD_ONCE_INIT FALSE @ 1.18 log @*** empty log message *** @ text @d80 1 @ 1.17 log @*** empty log message *** @ text @d190 9 @ 1.16 log @*** empty log message *** @ text @a221 1 int pthread_cancel(pthread_t); d234 2 a235 1 int pthread_testcancel(void); @ 1.15 log @*** empty log message *** @ text @d222 1 d355 1 d357 1 @ 1.14 log @*** empty log message *** @ text @d183 1 a183 1 * CondVar/RWLock static initialization values. d185 3 a187 6 pthread_mutex_t _pthread_mutex_init_static(void); pthread_cond_t _pthread_cond_init_static(void); pthread_rwlock_t _pthread_rwlock_init_static(void); #define PTHREAD_MUTEX_INITIALIZER _pthread_mutex_init_static() #define PTHREAD_COND_INITIALIZER _pthread_cond_init_static() #define PTHREAD_RWLOCK_INITIALIZER _pthread_rwlock_init_static() @ 1.13 log @*** empty log message *** @ text @d49 8 @ 1.12 log @*** empty log message *** @ text @d298 2 a299 2 /* * Thread-Safe functions d301 8 a308 3 /* optionally fake poll(2) data structure and options */ #if @@PTH_FAKE_POLL@@ a326 2 #else struct pollfd; d328 4 @ 1.11 log @*** empty log message *** @ text @d302 24 a330 1 int _pthread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *); d333 2 a345 1 #define select _pthread_select d348 2 @ 1.10 log @*** empty log message *** @ text @d100 6 d315 1 d326 1 @ 1.9 log @*** empty log message *** @ text @d301 1 d314 1 @ 1.8 log @*** empty log message *** @ text @d271 1 a271 6 /* * Extensions created by The Open Group as part * of the Single UNIX Specification, Version 2. */ /* lock attribute routines */ d277 1 a277 1 /* lock routines */ d287 6 d303 1 d305 1 a305 1 ssize_t _pthread_read(int, void *, size_t); a306 1 ssize_t _pthread_pread(int, void *, size_t, off_t); d315 1 a316 1 #define read _pthread_read d322 2 a323 1 #define sched_yield pthread_yield a324 1 #define pread _pthread_pread @ 1.7 log @*** empty log message *** @ text @d316 8 a323 2 #define pwrite _pthread_pwrite #define pread _pthread_pread @ 1.6 log @*** empty log message *** @ text @d7 1 a7 1 ** which can be found at http://www.engelschall.com/sw/pth/. @ 1.5 log @*** empty log message *** @ text @d6 1 a6 1 ** This file is part of PTH, a non-preemptive thread scheduling library @ 1.4 log @*** empty log message *** @ text @a294 4 @@FALLBACK_PID_T@@ @@FALLBACK_SIZE_T@@ @@FALLBACK_SSIZE_T@@ d304 2 d316 2 @ 1.3 log @*** empty log message *** @ text @d234 1 @ 1.2 log @*** empty log message *** @ text @d165 1 a165 1 PTHREAD_MUTEX_ERRORCHECK, @ 1.1 log @*** empty log message *** @ text @a30 1 #include d47 31 @