Esempio n. 1
0
static void *
_thr_rtld_lock_create(void)
{
	pthread_rwlock_t prwlock;
	if (_pthread_rwlock_init(&prwlock, NULL))
		return (NULL);
	return (prwlock);
}
Esempio n. 2
0
static int
init_static (pthread_rwlock_t *rwlock)
{
	int ret;

	_SPINLOCK(&static_init_lock);

	if (*rwlock == NULL)
		ret = _pthread_rwlock_init(rwlock, NULL);
	else
		ret = 0;

	_SPINUNLOCK(&static_init_lock);

	return (ret);
}
Esempio n. 3
0
static int
init_static(pthread_rwlock_t *rwlock)
{
	struct pthread *thread = _get_curthread();
	int ret;

	THR_LOCK_ACQUIRE(thread, &_rwlock_static_lock);

	if (*rwlock == NULL)
		ret = _pthread_rwlock_init(rwlock, NULL);
	else
		ret = 0;

	THR_LOCK_RELEASE(thread, &_rwlock_static_lock);
	return (ret);
}