NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PTHREAD_MUTEX_INITIALIZER on 6.1.5 issues



On Wed, May 30, 2018 at 10:34:10AM +0200, Riccardo Mottola wrote:
> well it should return a value, look here for POSIX:
> 
> http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_mutex_init.html

I don't see where it says that it should return a value. Note that the
synapsis give is exactly what works with NetBSD:

	pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;

and the description says:

	In cases where default mutex attributes are
	appropriate, the macro PTHREAD_MUTEX_INITIALIZER can
	be used to initialise mutexes that are statically
	allocated.

Especially note the "statically allocated".

Martin


Home | Main Index | Thread Index | Old Index