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()
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Nicola Pero <nicola dot pero at meta-innovation dot com>
- Cc: gcc-patches at gnu dot org
- Date: Sat, 4 Sep 2010 16:17:39 -0700
- Subject: Re: GNU Objective-C runtime support for @synchronized()
- References: <1283633079.369513754@192.168.2.227>
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