No subject


Sat Aug 1 23:30:28 PDT 2015


int
_pthread_mutex_trylock(pthread_mutex_t * mutex)
{
	struct pthread	*curthread = _get_curthread();
	int	ret = 0;
	if (mutex == NULL)
		ret = EINVAL;
	/*
	 * If the mutex is statically initialized, perform the dynamic
	 * initialization:
	 */
	else if (*mutex != NULL || (ret = init_static(mutex)) == 0) {
		/*
from libthread_xu:

int
__pthread_mutex_trylock(pthread_mutex_t *m)
{
	struct pthread *curthread = tls_get_curthread();
	int ret;
	/*
	 * If the mutex is statically initialized, perform the dynamic
	 * initialization:
	 */
	if (__predict_false(*m == NULL)) {
Not sure if we are required to catch NULL pointers?  They shouldn't pass 
them in the first place...

cheers
  simon
--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \





More information about the Bugs mailing list