[LTP] [PATCH v2 1/2] lib: add safe_pthread_create() & safe_pthread_join()

Cyril Hrubis chrubis@suse.cz
Thu Apr 7 13:35:31 CEST 2016


Hi!
> +int safe_pthread_join(const char *file, const int lineno,
> +		      pthread_t thread_id, void **retval)
> +{
> +	int rval;
> +
> +	rval = pthread_join(thread_id, retval);
> +
> +	if (rval) {
> +		tst_brk_(file, lineno, TBROK,
> +			 "pthread_join(%lu,%p) failed: %s", thread_id, retval,
> +			 tst_strerrno(rval));

Technically the thread_id does not need to be numeric type, POSIX
defines it as a opaque, may be structure as well.

But on the other hand I doubt that there is a Linux libc implementation
that actually defines it to be anything else than long int.

> +	}
> +
> +	return rval;
> +}

Otherwise this looks fine.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list