Date: Mon, 16 Jul 2012 18:18:53 -0400 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Re: thread local storage On Mon, Jul 16, 2012 at 11:30:01PM +0200, John Spencer wrote: > On 07/16/2012 10:09 PM, Rich Felker wrote: > > > >This is broken and non-thread-safe. Not a good idea. Instead try: > > thanks, very interesting. > > do you mind if i forward this to the luajit ml ? > looks as if this might fix the problem on OSX/OpenBSD as well. Please do. This is the correct, portable fix. Using __thread or _Thread_local might be prefered to avoid the init/cleanup need when possible, but the POSIX fallback should be used rather than falling back to code that will horribly crash or even yield privilege elevation under multi-threaded use. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.