[v3] c++0x <mutex> and <condition_variable>

Kai Henningsen kai.extern@googlemail.com
Sun Sep 7 19:59:00 GMT 2008


On Sun, Sep 7, 2008 at 20:49, Paolo Carlini <paolo.carlini@oracle.com> wrote:

> I think that in principle <mutex> and <condition_variable> should be
> available also when __GTHREADS is undefined, that is plain single thread, in
> a trivial form of course (see for example ext/concurrence.h). Can you
> imagine anything smart here, better than sprinkling tons of #if __GTHREADS
>  everywhere? If we can do that, we have also to adjust
> [GLIBCXX_CHECK_GTHREADS] to immediately succeed as soon  as __GTHREADS is
> undefined.

Instead of sprinkling #ifs, how about just supplying a single-thread
implementation of what __GTHREADS offers? Most of those would
presumably be dummy functions which'd vanish on inlining.



More information about the Gcc-patches mailing list