pthread.h, sys/types.h Add missing pthread methods
* pthread.h: Add prototypes for pthread_condattr_getclock(), pthread_condattr_setclock(), pthread_setschedpri(), pthread_getcpuclockid(), pthread_getconcurrency(), and pthread_setconcurrency(). Also cleaned up file header to remove CVS Id string. * sys/types.h: Add clock ID to pthread_condattr_t.
This commit is contained in:
		| @@ -1,8 +1,7 @@ | |||||||
| /*  pthread.h | /* | ||||||
|  |  *  Written by Joel Sherrill <joel.sherrill@OARcorp.com>. | ||||||
|  * |  * | ||||||
|  *  Written by Joel Sherrill <joel@OARcorp.com>. |  *  COPYRIGHT (c) 1989-2013, 2015. | ||||||
|  * |  | ||||||
|  *  COPYRIGHT (c) 1989-2013. |  | ||||||
|  *  On-Line Applications Research Corporation (OAR). |  *  On-Line Applications Research Corporation (OAR). | ||||||
|  * |  * | ||||||
|  *  Permission to use, copy, modify, and distribute this software for any |  *  Permission to use, copy, modify, and distribute this software for any | ||||||
| @@ -14,8 +13,6 @@ | |||||||
|  *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION |  *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION | ||||||
|  *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS |  *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS | ||||||
|  *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. |  *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. | ||||||
|  * |  | ||||||
|  *  $Id$ |  | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef __PTHREAD_h | #ifndef __PTHREAD_h | ||||||
| @@ -96,6 +93,13 @@ int	_EXFUN(pthread_mutex_timedlock, | |||||||
|   |   | ||||||
| int	_EXFUN(pthread_condattr_init, (pthread_condattr_t *__attr)); | int	_EXFUN(pthread_condattr_init, (pthread_condattr_t *__attr)); | ||||||
| int	_EXFUN(pthread_condattr_destroy, (pthread_condattr_t *__attr)); | int	_EXFUN(pthread_condattr_destroy, (pthread_condattr_t *__attr)); | ||||||
|  |  | ||||||
|  | int	_EXFUN(pthread_condattr_getclock, | ||||||
|  | 		(const pthread_condattr_t *__restrict __attr, | ||||||
|  |               clockid_t *__restrict __clock_id)); | ||||||
|  | int	_EXFUN(pthread_condattr_setclock, | ||||||
|  | 		(pthread_condattr_t *__attr, clockid_t __clock_id)); | ||||||
|  |  | ||||||
| int	_EXFUN(pthread_condattr_getpshared, | int	_EXFUN(pthread_condattr_getpshared, | ||||||
| 		(_CONST pthread_condattr_t *__attr, int *__pshared)); | 		(_CONST pthread_condattr_t *__attr, int *__pshared)); | ||||||
| int	_EXFUN(pthread_condattr_setpshared, | int	_EXFUN(pthread_condattr_setpshared, | ||||||
| @@ -161,6 +165,9 @@ int	_EXFUN(pthread_getschedparam, | |||||||
| int	_EXFUN(pthread_setschedparam, | int	_EXFUN(pthread_setschedparam, | ||||||
| 	(pthread_t __pthread, int __policy, struct sched_param *__param)); | 	(pthread_t __pthread, int __policy, struct sched_param *__param)); | ||||||
|  |  | ||||||
|  | /* Set Scheduling Priority of a Thread */ | ||||||
|  | int	_EXFUN(pthread_setschedprio, (pthread_t thread, int prio)); | ||||||
|  |  | ||||||
| #endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ | #endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ | ||||||
|  |  | ||||||
| #if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT) | #if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT) | ||||||
| @@ -263,6 +270,14 @@ pthread_t	_EXFUN(pthread_self, (void)); | |||||||
|  |  | ||||||
| int	_EXFUN(pthread_equal, (pthread_t __t1, pthread_t __t2)); | int	_EXFUN(pthread_equal, (pthread_t __t1, pthread_t __t2)); | ||||||
|  |  | ||||||
|  | /* Retrieve ID of a Thread's CPU Time Clock */ | ||||||
|  | int	_EXFUN(pthread_getcpuclockid, | ||||||
|  | 		(pthread_t thread, clockid_t *clock_id)); | ||||||
|  |  | ||||||
|  | /* Get/Set Current Thread's Concurrency Level */ | ||||||
|  | int	_EXFUN(pthread_setconcurrency, (int new_level)); | ||||||
|  | int	_EXFUN(pthread_getconcurrency, (void)); | ||||||
|  |  | ||||||
| /* Dynamic Package Initialization */ | /* Dynamic Package Initialization */ | ||||||
|  |  | ||||||
| /* This is used to statically initialize a pthread_once_t. Example: | /* This is used to statically initialize a pthread_once_t. Example: | ||||||
|   | |||||||
| @@ -410,6 +410,7 @@ typedef __uint32_t pthread_cond_t;       /* identify a condition variable */ | |||||||
|  |  | ||||||
| typedef struct { | typedef struct { | ||||||
|   int      is_initialized; |   int      is_initialized; | ||||||
|  |   clock_t  clock;             /* specifiy clock for timeouts */ | ||||||
| #if defined(_POSIX_THREAD_PROCESS_SHARED) | #if defined(_POSIX_THREAD_PROCESS_SHARED) | ||||||
|   int      process_shared;    /* allow this to be shared amongst processes */ |   int      process_shared;    /* allow this to be shared amongst processes */ | ||||||
| #endif | #endif | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user