C11 threads ABI questions - enum values

Rich Felker dalias@libc.org
Wed Oct 1 21:16:00 GMT 2014


On Wed, Oct 01, 2014 at 02:13:08PM -0700, Roland McGrath wrote:
> > Yes, I think there's some value in being able to track what the
> > calling application _asked_ for, e.g. in the debugger, even if the
> > request is meaningless from an implementation standpoint.
> > 
> > After thinking about it more, I'm probably mildly in favor of using
> > enum constants unrelated to the values of the pthread ones (at least
> > not in any official relationship).
> 
> I concur on both points.

Thanks for the feedback. Since then we've got C11 threads support
committed in musl, with the following definitions. Are these
acceptable for glibc too? They're the same ones I proposed before.

enum {
	thrd_success  = 0,
	thrd_busy     = 1,
	thrd_error    = 2,
	thrd_nomem    = 3,
	thrd_timedout = 4,
};

enum {
	mtx_plain     = 0,
	mtx_recursive = 1,
	mtx_timed     = 2,
};

Rich



More information about the Libc-alpha mailing list