This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51906] thread lock test failures on darwin11 under Xcode 4.2
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 31 Jan 2012 11:23:55 +0000
- Subject: [Bug libstdc++/51906] thread lock test failures on darwin11 under Xcode 4.2
- Auto-submitted: auto-generated
- References: <bug-51906-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51906
--- Comment #31 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-31 11:23:55 UTC ---
(In reply to comment #30)
> it outputs "22"
and it returns 0 with _XOPEN_SOURCE defined?
> which appears to be...
>
>
> The pthread_mutex_lock() and pthread_mutex_trylock() functions shall
> fail if:
>
> EINVAL The mutex was created with the protocol attribute having the
> value PTHREAD_PRIO_PROTECT and the calling thread's priority is
> higher than the mutex's current priority ceiling.
That's the POSIX spec, but priorities don't apply to that test. The Mac OS X
pthread_mutex_trylock(3) man page (which doesn't seem to have been updated
since it was copied from BSD) says simply
[EINVAL] The value specified by mutex is invalid.
and the pthread(3) man page says "The default system libraries include pthread
functions. No additional libraries or CFLAGS are necessary to use this API"
which isn't true if _XOPEN_SOURCE is needed.