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: std::call_once without TLS


> Here's an ABI-compatible patch to fix libstdc++/39909, it would be
> good if Chris or Benjamin could review it.
>
> Code using the new ABI will use a lock object on the caller's stack
> and provide a pointer to it, if the pointer is NULL then the caller is
> using the old ABI the global lock object.

Many apologize for being absent on this issue.

This non-ABI breaking patch applies only to 4.4 right?

Note that archs that want to use the new libstdc++ thread stuff are
required to implement:

int __gthread_key_create (__gthread_key_t *keyp, void (*dtor) (void *))
int __gthread_key_delete (__gthread_key_t key)
void *__gthread_getspecific (__gthread_key_t key)
int __gthread_setspecific (__gthread_key_t key, const void *ptr)

(see gcc/gthr.h)

Jonathon, if you have a better solution in mind, they are at your disposal.

As for trunk, can we still use the abi-breaking fix? I can't recall if
function's move-assign operator is allowed to throw and even if its
not, its certainly preferable to hold a global mutex in a
stack-allocated unique_lock.

Chris


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