This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] mutex, condition_variable
On Tue, May 6, 2008 at 5:29 PM, Andrew Pinski <pinskia@gmail.com> wrote:
>
> On Tue, May 6, 2008 at 5:22 PM, NightStrike <nightstrike@gmail.com> wrote:
> > On 5/6/08, 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.
> > >
> > > This is the the subset of chapter 30 that (arguably) will not require
> > > new extensions to the gthr.h interface, and so my thinking was to stage
> > > this in first.
> > >
> > > tested x86_64/linux
> > > tested x86_64/linux --disable-threads
> > >
> > > -benjamin
> > >
> > >
> > >
> >
> >
> > This patch breaks windows targets. See:
> > http://gcc.gnu.org/ml/libstdc++/2008-05/msg00022.html
>
> More information on this failure:
> From gthr.h:
> __GTHREAD_MUTEX_INIT_FUNCTION
> some systems can't initialize a mutex without a
> function call. On such systems, define this to a
> function which looks like this:
> void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *)
> Don't define __GTHREAD_MUTEX_INIT in this case
>
> but we use it as returning an int:
> int __e = __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex);
Likewise for __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION.
Also __GTHREAD_ONCE_INIT is defined as:
#define __GTHREAD_ONCE_INIT {0, -1}
I don't think PTHREAD_ONCE_INIT has to be define as a constant or a
simple variable either.
Thanks,
Andrew Pinski