This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] mutex, condition_variable


On Tue, May 6, 2008 at 2:22 PM, Benjamin Kosnik <bkoz@redhat.com> wrote:
>
>  This adds in preliminary support for C++0x mutex/condition_variable, as
>  first posted here:
>  http://gcc.gnu.org/ml/libstdc++/2008-03/msg00059.html
>
>  Large parts of mutex are taken from the existing support in
>  ext/concurrence.h, which explains the copyright dates on that file.

30_threads/mutex/try_lock/2.cc  fails on darwin because try_lock
throws an exception.
pthread_mutex_trylock returns EBUSY which is correct as the mutex is
already locked.  I have not looked into what the C++0x standard says
though about what happens when try_lock fails because it is already
locked but the POSIX standard is clear what the behavior of
pthread_mutex_trylock is here.
The pthread_mutex_trylock() function shall fail if:
[EBUSY]
The mutex could not be acquired because it was already locked.

I think GNU/Linux is not returning the correct value here as far as I
can tell from reading the POSIX standard.

Thanks,
Andrew Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]