This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GNU Objective-C runtime support for @synchronized()
On Sat, Sep 4, 2010 at 4:17 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Sat, Sep 4, 2010 at 1:44 PM, Nicola Pero
> <nicola.pero@meta-innovation.com> wrote:
>> The reason I had to do this long-due refactoring before implementing
>> @synchronized is that a good implementation of @synchronized()
>> requires thread-local storage to implement a lock cache, but general
>> thread-local storage is not available through the __objc... backend,
>> only directly through the __gthread_... layer. ÂSo, @synchronized() would
>> break the __objc... layer anyway.
>
> I think we should use __thread keyword as the thread local storage if
> the toolchain supports either the emulated version or the native
> version and disable the cache otherwise.
>
> The rest of the patch looks good.
I forgot to mention this is PR 23680. And can you add a testcase or two?
Thanks,
Andrew Pinski