https://sourceware.org/bugzilla/show_bug.cgi?id=23424

--- Comment #2 from Cary Coutant <ccoutant at gmail dot com> ---
> It seems that using PTHREAD_ONCE_INIT can only be used in a static context, as
> documented in the man page (https://linux.die.net/man/3/pthread_once). Since
> it's POD, doing a deep copy with a statically initialized dummy should be a
> pragmatic workaround (see attached patch).

Can you point out where in that man page you found this? I've read
several man pages for pthread_once, and can't find any such
restriction on the use of PTHREAD_ONCE_INIT.

> Side note - the man page says that "The behavior of pthread_once() is 
> undefined
> if once_control has automatic storage duration", which might happen when using
> the Once class.

I'm pretty sure that all classes that derive from Once are allocated
either statically or with new. This shouldn't be an issue.

-cary

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to