PR testsuite/35677
* emutls.c (__emutls_get_address): Make sure offset is really zero
before initializing the object's offset.
From-SVN: r142687
+2008-12-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR testsuite/35677
+ * emutls.c (__emutls_get_address): Make sure offset is really zero
+ before initializing the object's offset.
+
2008-12-11 Jakub Jelinek <jakub@redhat.com>
PR c++/38253
static __gthread_once_t once = __GTHREAD_ONCE_INIT;
__gthread_once (&once, emutls_init);
__gthread_mutex_lock (&emutls_mutex);
- offset = ++emutls_size;
- obj->loc.offset = offset;
+ offset = obj->loc.offset;
+ if (offset == 0)
+ {
+ offset = ++emutls_size;
+ obj->loc.offset = offset;
+ }
__gthread_mutex_unlock (&emutls_mutex);
}