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: [c++0x] mutex and condition variable initializers


2009/5/13 Benjamin Kosnik:
>
>> Would it be worth adding a configure check to see if that works with
>> the chosen threading model and using it when possible?
>
> Well, since the actual code is conditional on
> _GTHREAD_MUTEX_INIT/_GTHREAD_COND_INIT, and you are only dealing with
> half of it, how are you planning on dealing with the other part of the
> condition? ie, _GTHREAD_MUTEX_INIT_FUNCTION? Don't see how this would
> end up being a win.

Yes, you've spotted the flaw  :-)
It would probably end up with three cases, the new initializer form
for posix-like gthr laters, the current assignment from temporary form
for e.g. gthr-single.h where the INIT macros expand to 0, and the
function call for when there's no INIT macro.

Probably not worth changing, since it only appears in two places.  Oh well.

Jonathan


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