This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: variadic arguments not thread safe on amd64?
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Matt Provost <mprovost at termcap dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 27 Apr 2009 20:49:27 -0700
- Subject: Re: variadic arguments not thread safe on amd64?
- References: <20090428033741.GO2473@newinst.layeredtech.com>
On Mon, Apr 27, 2009 at 8:37 PM, Matt Provost <mprovost@termcap.net> wrote:
> void tdebug(const char *format, ...) {
> Â Âva_list ap;
> Â Âpthread_mutex_lock(&m);
> Â Âmylog.format = format;
> Â Âva_start(ap, format);
> Â Âva_copy(mylog.ap, ap);
> Â Âpthread_cond_signal(&c);
> Â Âpthread_mutex_unlock(&m);
You are missing two va_end's here
-- Pinski