This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] c++0x <mutex> and <condition_variable>
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.