- Prefix MUTEX_TYPE_MAX with PTHREAD_ to avoid namespace pollution.

- Remove the macros MUTEX_TYPE_FAST and MUTEX_TYPE_COUNTING_FAST.

OK'ed by:	deischen
This commit is contained in:
stefanf 2005-08-19 21:31:42 +00:00
parent 8c74153b9c
commit cb1c3eea78
9 changed files with 13 additions and 17 deletions

View File

@ -121,8 +121,6 @@
*
* PTHREAD_MUTEX_NORMAL
* PTHREAD_MUTEX_RECURSIVE
* MUTEX_TYPE_FAST (deprecated)
* MUTEX_TYPE_COUNTING_FAST (deprecated)
*
* will deviate from POSIX specified semantics.
*/
@ -130,12 +128,10 @@ enum pthread_mutextype {
PTHREAD_MUTEX_ERRORCHECK = 1, /* Default POSIX mutex */
PTHREAD_MUTEX_RECURSIVE = 2, /* Recursive mutex */
PTHREAD_MUTEX_NORMAL = 3, /* No error checking */
MUTEX_TYPE_MAX
PTHREAD_MUTEX_TYPE_MAX
};
#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK
#define MUTEX_TYPE_FAST PTHREAD_MUTEX_NORMAL
#define MUTEX_TYPE_COUNTING_FAST PTHREAD_MUTEX_RECURSIVE
/*
* Thread function prototype definitions:

View File

@ -71,7 +71,7 @@ int
_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
{
int ret;
if (attr == NULL || *attr == NULL || type >= MUTEX_TYPE_MAX) {
if (attr == NULL || *attr == NULL || type >= PTHREAD_MUTEX_TYPE_MAX) {
errno = EINVAL;
ret = -1;
} else {
@ -87,7 +87,7 @@ _pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *type)
int ret;
if (attr == NULL || *attr == NULL || (*attr)->m_type >=
MUTEX_TYPE_MAX) {
PTHREAD_MUTEX_TYPE_MAX) {
ret = EINVAL;
} else {
*type = (*attr)->m_type;

View File

@ -144,7 +144,7 @@ _pthread_mutex_init(pthread_mutex_t * mutex,
/* Check mutex type: */
else if (((*mutex_attr)->m_type < PTHREAD_MUTEX_ERRORCHECK) ||
((*mutex_attr)->m_type >= MUTEX_TYPE_MAX))
((*mutex_attr)->m_type >= PTHREAD_MUTEX_TYPE_MAX))
/* Return an invalid argument error: */
ret = EINVAL;

View File

@ -71,7 +71,7 @@ int
_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
{
int ret;
if (attr == NULL || *attr == NULL || type >= MUTEX_TYPE_MAX) {
if (attr == NULL || *attr == NULL || type >= PTHREAD_MUTEX_TYPE_MAX) {
errno = EINVAL;
ret = -1;
} else {
@ -87,7 +87,7 @@ _pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *type)
int ret;
if (attr == NULL || *attr == NULL || (*attr)->m_type >=
MUTEX_TYPE_MAX) {
PTHREAD_MUTEX_TYPE_MAX) {
ret = EINVAL;
} else {
*type = (*attr)->m_type;

View File

@ -128,7 +128,7 @@ __pthread_mutex_init(pthread_mutex_t *mutex,
/* Check mutex type: */
else if (((*mutex_attr)->m_type < PTHREAD_MUTEX_ERRORCHECK) ||
((*mutex_attr)->m_type >= MUTEX_TYPE_MAX))
((*mutex_attr)->m_type >= PTHREAD_MUTEX_TYPE_MAX))
/* Return an invalid argument error: */
ret = EINVAL;

View File

@ -71,7 +71,7 @@ int
_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
{
int ret;
if (attr == NULL || *attr == NULL || type >= MUTEX_TYPE_MAX) {
if (attr == NULL || *attr == NULL || type >= PTHREAD_MUTEX_TYPE_MAX) {
errno = EINVAL;
ret = -1;
} else {
@ -87,7 +87,7 @@ _pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *type)
int ret;
if (attr == NULL || *attr == NULL || (*attr)->m_type >=
MUTEX_TYPE_MAX) {
PTHREAD_MUTEX_TYPE_MAX) {
ret = EINVAL;
} else {
*type = (*attr)->m_type;

View File

@ -128,7 +128,7 @@ __pthread_mutex_init(pthread_mutex_t *mutex,
/* Check mutex type: */
else if (((*mutex_attr)->m_type < PTHREAD_MUTEX_ERRORCHECK) ||
((*mutex_attr)->m_type >= MUTEX_TYPE_MAX))
((*mutex_attr)->m_type >= PTHREAD_MUTEX_TYPE_MAX))
/* Return an invalid argument error: */
ret = EINVAL;

View File

@ -120,7 +120,7 @@ mutex_init(pthread_mutex_t *mutex,
/* Check mutex type: */
else if (((*mutex_attr)->m_type < PTHREAD_MUTEX_ERRORCHECK) ||
((*mutex_attr)->m_type >= MUTEX_TYPE_MAX))
((*mutex_attr)->m_type >= PTHREAD_MUTEX_TYPE_MAX))
/* Return an invalid argument error: */
ret = EINVAL;

View File

@ -127,7 +127,7 @@ int
_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
{
int ret;
if (attr == NULL || *attr == NULL || type >= MUTEX_TYPE_MAX) {
if (attr == NULL || *attr == NULL || type >= PTHREAD_MUTEX_TYPE_MAX) {
errno = EINVAL;
ret = -1;
} else {
@ -143,7 +143,7 @@ _pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *type)
int ret;
if (attr == NULL || *attr == NULL || (*attr)->m_type >=
MUTEX_TYPE_MAX) {
PTHREAD_MUTEX_TYPE_MAX) {
ret = EINVAL;
} else {
*type = (*attr)->m_type;