I botched one of my committs in the last round. Fix it.
This commit is contained in:
parent
e07f1d5fd7
commit
6e1aa51e9e
@ -529,10 +529,11 @@ cond_queue_enq(pthread_cond_t cond, pthread_t pthread)
|
|||||||
static inline int
|
static inline int
|
||||||
cond_init(pthread_cond_t *cond)
|
cond_init(pthread_cond_t *cond)
|
||||||
{
|
{
|
||||||
|
int error = 0;
|
||||||
_SPINLOCK(&static_cond_lock);
|
_SPINLOCK(&static_cond_lock);
|
||||||
if (*cond == PTHREAD_COND_INITIALIZER)
|
if (*cond == PTHREAD_COND_INITIALIZER)
|
||||||
return (_pthread_cond_init(cond, NULL));
|
error = _pthread_cond_init(cond, NULL);
|
||||||
_SPINUNLOCK(&static_cond_lock);
|
_SPINUNLOCK(&static_cond_lock);
|
||||||
return (0);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,25 +269,23 @@ _pthread_mutex_destroy(pthread_mutex_t * mutex)
|
|||||||
static int
|
static int
|
||||||
init_static(pthread_mutex_t *mutex)
|
init_static(pthread_mutex_t *mutex)
|
||||||
{
|
{
|
||||||
|
int error = 0;
|
||||||
_SPINLOCK(&static_init_lock);
|
_SPINLOCK(&static_init_lock);
|
||||||
if (*mutex == PTHREAD_MUTEX_INITIALIZER) {
|
if (*mutex == PTHREAD_MUTEX_INITIALIZER)
|
||||||
_SPINUNLOCK(&static_init_lock);
|
error = _pthread_mutex_init(mutex, NULL);
|
||||||
return(_pthread_mutex_init(mutex, NULL));
|
|
||||||
}
|
|
||||||
_SPINUNLOCK(&static_init_lock);
|
_SPINUNLOCK(&static_init_lock);
|
||||||
return (0);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
init_static_private(pthread_mutex_t *mutex)
|
init_static_private(pthread_mutex_t *mutex)
|
||||||
{
|
{
|
||||||
|
int error = 0;
|
||||||
_SPINLOCK(&static_init_lock);
|
_SPINLOCK(&static_init_lock);
|
||||||
if (*mutex == PTHREAD_MUTEX_INITIALIZER) {
|
if (*mutex == PTHREAD_MUTEX_INITIALIZER)
|
||||||
_SPINUNLOCK(&static_init_lock);
|
error = _pthread_mutex_init(mutex, &static_mattr);
|
||||||
return (_pthread_mutex_init(mutex, &static_mattr));
|
|
||||||
}
|
|
||||||
_SPINUNLOCK(&static_init_lock);
|
_SPINUNLOCK(&static_init_lock);
|
||||||
return (0);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user