Exemplo n.º 1
0
int
pthread_mutex_lock(pthread_mutex_t *mutex)
{
	int	ret = 0;

	if (_thread_initial == NULL)
		_thread_init();

	if (mutex == NULL)
		ret = EINVAL;

	/*
	 * If the mutex is statically initialized, perform the dynamic
	 * initialization. Note: _thread_mutex_lock() in libc requires
	 * pthread_mutex_lock() to perform the mutex init when *mutex
	 * is NULL.
	 */
	else if ((*mutex != NULL) || ((ret = init_static(mutex)) == 0))
		ret = mutex_lock_common(mutex);

	return (ret);
}
Exemplo n.º 2
0
int vmm_mutex_lock_timeout(struct vmm_mutex *mut, u64 *timeout)
{
	return mutex_lock_common(mut, timeout);
}
Exemplo n.º 3
0
int vmm_mutex_lock(struct vmm_mutex *mut)
{
	return mutex_lock_common(mut, NULL);
}