summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2016-06-07 11:09:32 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2016-06-07 11:09:32 +0000
commit723c8a093c1a79bf03793a2b34befd65bf365737 (patch)
treedf780c83667fedd03e92b9cab0e40ca591c09d0a
parent5aaab9921729d6e41146d8ba5e9dcb01b042f41f (diff)
parenta90d75b828f0c01a350c4ecfc3924fd6456fffaf (diff)
downloadillumos-joyent-723c8a093c1a79bf03793a2b34befd65bf365737.tar.gz
[illumos-gate merge]20160526
commit a90d75b828f0c01a350c4ecfc3924fd6456fffaf 6993 DEFAULT_TYPE should be probably be removed from pthread.h
-rw-r--r--usr/src/head/pthread.h11
-rw-r--r--usr/src/lib/libc/port/threads/pthr_barrier.c4
-rw-r--r--usr/src/lib/libc/port/threads/pthr_cond.c6
-rw-r--r--usr/src/lib/libc/port/threads/pthr_mutex.c4
-rw-r--r--usr/src/lib/libc/port/threads/pthr_rwlock.c6
5 files changed, 10 insertions, 21 deletions
diff --git a/usr/src/head/pthread.h b/usr/src/head/pthread.h
index 5fe007bf90..91d268a30d 100644
--- a/usr/src/head/pthread.h
+++ b/usr/src/head/pthread.h
@@ -69,11 +69,6 @@ extern "C" {
#define PTHREAD_PROCESS_SHARED 1 /* = USYNC_PROCESS */
#define PTHREAD_PROCESS_PRIVATE 0 /* = USYNC_THREAD */
-#define _DEFAULT_TYPE PTHREAD_PROCESS_PRIVATE
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-#define DEFAULT_TYPE _DEFAULT_TYPE
-#endif
-
/*
* mutex types
* keep these in synch which sys/synch.h lock flags
@@ -113,13 +108,13 @@ extern "C" {
* should be consistent with the definition for pthread_mutex_t).
*/
#define PTHREAD_MUTEX_INITIALIZER /* = DEFAULTMUTEX */ \
- {{0, 0, 0, _DEFAULT_TYPE, _MUTEX_MAGIC}, {{{0}}}, 0}
+ {{0, 0, 0, PTHREAD_PROCESS_PRIVATE, _MUTEX_MAGIC}, {{{0}}}, 0}
#define PTHREAD_COND_INITIALIZER /* = DEFAULTCV */ \
- {{{0, 0, 0, 0}, _DEFAULT_TYPE, _COND_MAGIC}, 0}
+ {{{0, 0, 0, 0}, PTHREAD_PROCESS_PRIVATE, _COND_MAGIC}, 0}
#define PTHREAD_RWLOCK_INITIALIZER /* = DEFAULTRWLOCK */ \
- {0, _DEFAULT_TYPE, _RWL_MAGIC, PTHREAD_MUTEX_INITIALIZER, \
+ {0, PTHREAD_PROCESS_PRIVATE, _RWL_MAGIC, PTHREAD_MUTEX_INITIALIZER, \
PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER}
/* cancellation type and state */
diff --git a/usr/src/lib/libc/port/threads/pthr_barrier.c b/usr/src/lib/libc/port/threads/pthr_barrier.c
index 3a76abb2b8..6f4f75445f 100644
--- a/usr/src/lib/libc/port/threads/pthr_barrier.c
+++ b/usr/src/lib/libc/port/threads/pthr_barrier.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "lint.h"
#include "thr_uberdata.h"
#include <pthread.h>
@@ -94,7 +92,7 @@ pthread_barrier_init(pthread_barrier_t *barrier,
int type;
if (attr == NULL)
- type = DEFAULT_TYPE;
+ type = PTHREAD_PROCESS_PRIVATE;
else if ((ap = attr->__pthread_barrierattrp) != NULL)
type = ap->pshared;
else
diff --git a/usr/src/lib/libc/port/threads/pthr_cond.c b/usr/src/lib/libc/port/threads/pthr_cond.c
index b22bc27cf2..22f81af8ff 100644
--- a/usr/src/lib/libc/port/threads/pthr_cond.c
+++ b/usr/src/lib/libc/port/threads/pthr_cond.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "lint.h"
#include "thr_uberdata.h"
@@ -41,7 +39,7 @@ pthread_condattr_init(pthread_condattr_t *attr)
if ((ap = lmalloc(sizeof (cvattr_t))) == NULL)
return (ENOMEM);
- ap->pshared = DEFAULT_TYPE;
+ ap->pshared = PTHREAD_PROCESS_PRIVATE;
ap->clockid = CLOCK_REALTIME;
attr->__pthread_condattrp = ap;
return (0);
@@ -143,7 +141,7 @@ pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
int error;
if (attr == NULL) {
- type = DEFAULT_TYPE;
+ type = PTHREAD_PROCESS_PRIVATE;
clock_id = CLOCK_REALTIME;
} else if ((ap = attr->__pthread_condattrp) != NULL) {
type = ap->pshared;
diff --git a/usr/src/lib/libc/port/threads/pthr_mutex.c b/usr/src/lib/libc/port/threads/pthr_mutex.c
index f8134ef1a4..1f70725677 100644
--- a/usr/src/lib/libc/port/threads/pthr_mutex.c
+++ b/usr/src/lib/libc/port/threads/pthr_mutex.c
@@ -40,7 +40,7 @@ pthread_mutexattr_init(pthread_mutexattr_t *attr)
if ((ap = lmalloc(sizeof (mattr_t))) == NULL)
return (ENOMEM);
- ap->pshared = DEFAULT_TYPE;
+ ap->pshared = PTHREAD_PROCESS_PRIVATE;
ap->type = PTHREAD_MUTEX_DEFAULT;
ap->protocol = PTHREAD_PRIO_NONE;
ap->robustness = PTHREAD_MUTEX_STALLED;
@@ -222,7 +222,7 @@ pthread_mutex_init(pthread_mutex_t *_RESTRICT_KYWD mutex,
if (ap->protocol == PTHREAD_PRIO_PROTECT)
prioceiling = ap->prioceiling;
} else {
- type = DEFAULT_TYPE | PTHREAD_MUTEX_DEFAULT |
+ type = PTHREAD_PROCESS_PRIVATE | PTHREAD_MUTEX_DEFAULT |
PTHREAD_PRIO_NONE | PTHREAD_MUTEX_STALLED;
}
diff --git a/usr/src/lib/libc/port/threads/pthr_rwlock.c b/usr/src/lib/libc/port/threads/pthr_rwlock.c
index 39883d7934..44be459259 100644
--- a/usr/src/lib/libc/port/threads/pthr_rwlock.c
+++ b/usr/src/lib/libc/port/threads/pthr_rwlock.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "lint.h"
#include "thr_uberdata.h"
@@ -41,7 +39,7 @@ pthread_rwlockattr_init(pthread_rwlockattr_t *attr)
if ((ap = lmalloc(sizeof (rwlattr_t))) == NULL)
return (ENOMEM);
- ap->pshared = DEFAULT_TYPE;
+ ap->pshared = PTHREAD_PROCESS_PRIVATE;
attr->__pthread_rwlockattrp = ap;
return (0);
}
@@ -109,7 +107,7 @@ pthread_rwlock_init(pthread_rwlock_t *_RESTRICT_KYWD rwlock,
int type;
if (attr == NULL)
- type = DEFAULT_TYPE;
+ type = PTHREAD_PROCESS_PRIVATE;
else if ((ap = attr->__pthread_rwlockattrp) != NULL)
type = ap->pshared;
else