Project

General

Profile

Bug #6993 ยป 0001-6993-DEFAULT_TYPE-should-be-probably-be-removed-from.patch

Richard PALO, 2016-05-24 01:06 PM

View differences:

usr/src/head/pthread.h
69 69
#define	PTHREAD_PROCESS_SHARED		1	/* = USYNC_PROCESS */
70 70
#define	PTHREAD_PROCESS_PRIVATE		0	/* = USYNC_THREAD */
71 71

  
72
#define	_DEFAULT_TYPE 			PTHREAD_PROCESS_PRIVATE
73
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
74
#define	DEFAULT_TYPE			_DEFAULT_TYPE
75
#endif
76

  
77 72
/*
78 73
 * mutex types
79 74
 * keep these in synch which sys/synch.h lock flags
......
113 108
 * should be consistent with the definition for pthread_mutex_t).
114 109
 */
115 110
#define	PTHREAD_MUTEX_INITIALIZER		/* = DEFAULTMUTEX */	\
116
	{{0, 0, 0, _DEFAULT_TYPE, _MUTEX_MAGIC}, {{{0}}}, 0}
111
	{{0, 0, 0, PTHREAD_PROCESS_PRIVATE, _MUTEX_MAGIC}, {{{0}}}, 0}
117 112

  
118 113
#define	PTHREAD_COND_INITIALIZER		/* = DEFAULTCV */	\
119
	{{{0, 0, 0, 0}, _DEFAULT_TYPE, _COND_MAGIC}, 0}
114
	{{{0, 0, 0, 0}, PTHREAD_PROCESS_PRIVATE, _COND_MAGIC}, 0}
120 115

  
121 116
#define	PTHREAD_RWLOCK_INITIALIZER		/* = DEFAULTRWLOCK */	\
122
	{0, _DEFAULT_TYPE, _RWL_MAGIC, PTHREAD_MUTEX_INITIALIZER,	\
117
	{0, PTHREAD_PROCESS_PRIVATE, _RWL_MAGIC, PTHREAD_MUTEX_INITIALIZER,	\
123 118
	PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER}
124 119

  
125 120
/* cancellation type and state */
usr/src/lib/libc/port/threads/pthr_barrier.c
94 94
	int type;
95 95

  
96 96
	if (attr == NULL)
97
		type = DEFAULT_TYPE;
97
		type = PTHREAD_PROCESS_PRIVATE;
98 98
	else if ((ap = attr->__pthread_barrierattrp) != NULL)
99 99
		type = ap->pshared;
100 100
	else
usr/src/lib/libc/port/threads/pthr_cond.c
41 41

  
42 42
	if ((ap = lmalloc(sizeof (cvattr_t))) == NULL)
43 43
		return (ENOMEM);
44
	ap->pshared = DEFAULT_TYPE;
44
	ap->pshared = PTHREAD_PROCESS_PRIVATE;
45 45
	ap->clockid = CLOCK_REALTIME;
46 46
	attr->__pthread_condattrp = ap;
47 47
	return (0);
......
143 143
	int error;
144 144

  
145 145
	if (attr == NULL) {
146
		type = DEFAULT_TYPE;
146
		type = PTHREAD_PROCESS_PRIVATE;
147 147
		clock_id = CLOCK_REALTIME;
148 148
	} else if ((ap = attr->__pthread_condattrp) != NULL) {
149 149
		type = ap->pshared;
usr/src/lib/libc/port/threads/pthr_mutex.c
40 40

  
41 41
	if ((ap = lmalloc(sizeof (mattr_t))) == NULL)
42 42
		return (ENOMEM);
43
	ap->pshared = DEFAULT_TYPE;
43
	ap->pshared = PTHREAD_PROCESS_PRIVATE;
44 44
	ap->type = PTHREAD_MUTEX_DEFAULT;
45 45
	ap->protocol = PTHREAD_PRIO_NONE;
46 46
	ap->robustness = PTHREAD_MUTEX_STALLED;
......
222 222
		if (ap->protocol == PTHREAD_PRIO_PROTECT)
223 223
			prioceiling = ap->prioceiling;
224 224
	} else {
225
		type = DEFAULT_TYPE | PTHREAD_MUTEX_DEFAULT |
225
		type = PTHREAD_PROCESS_PRIVATE | PTHREAD_MUTEX_DEFAULT |
226 226
		    PTHREAD_PRIO_NONE | PTHREAD_MUTEX_STALLED;
227 227
	}
228 228

  
usr/src/lib/libc/port/threads/pthr_rwlock.c
41 41

  
42 42
	if ((ap = lmalloc(sizeof (rwlattr_t))) == NULL)
43 43
		return (ENOMEM);
44
	ap->pshared = DEFAULT_TYPE;
44
	ap->pshared = PTHREAD_PROCESS_PRIVATE;
45 45
	attr->__pthread_rwlockattrp = ap;
46 46
	return (0);
47 47
}
......
109 109
	int type;
110 110

  
111 111
	if (attr == NULL)
112
		type = DEFAULT_TYPE;
112
		type = PTHREAD_PROCESS_PRIVATE;
113 113
	else if ((ap = attr->__pthread_rwlockattrp) != NULL)
114 114
		type = ap->pshared;
115 115
	else
    (1-1/1)