GNU Objective-C runtime support for @synchronized()

Andrew Pinski pinskia@gmail.com
Sat Sep 4 23:19:00 GMT 2010


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.

Thanks,
Andrew Pinski



More information about the Gcc-patches mailing list