10.8. Data Definitions for libpthread

This section defines global identifiers and their values that are associated with interfaces contained in libpthread. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.

This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.

This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.

10.8.1. pthread.h


#define __SIZEOF_PTHREAD_BARRIER_T	32
#define __SIZEOF_PTHREAD_MUTEX_T	40
#define __SIZEOF_PTHREAD_ATTR_T	56
#define __SIZEOF_PTHREAD_RWLOCK_T	56
#define PTHREAD_RWLOCK_INITIALIZER	{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
#define PTHREAD_MUTEX_INITIALIZER	{ { 0, 0, 0, 0, 0, 0, { 0, 0 } } }

typedef union {
    char __size[__SIZEOF_PTHREAD_BARRIER_T];
    long int __align;
} pthread_barrier_t;

typedef struct __pthread_internal_list __pthread_list_t;
struct __pthread_mutex_s {
    int __lock;
    unsigned int __count;
    int __owner;
    unsigned int __nusers;
    int __kind;
    int __spins;
    __pthread_list_t __list;
};

typedef union {
    struct {
	int __lock;
	unsigned int __nr_readers;
	unsigned int __readers_wakeup;
	unsigned int __writer_wakeup;
	unsigned int __nr_readers_queued;
	unsigned int __nr_writers_queued;
	int __writer;
	int __pad1;
	unsigned long int __pad2;
	unsigned long int __pad3;
	unsigned int __flags;
    } __data;
    char __size[__SIZEOF_PTHREAD_RWLOCK_T];
    long int __align;
} pthread_rwlock_t;

10.8.2. semaphore.h


#define __SIZEOF_SEM_T	32