Lines 136-142
__emutls_get_address (struct __emutls_object *obj)
Link Here
|
136 |
#ifndef __GTHREADS |
136 |
#ifndef __GTHREADS |
137 |
abort (); |
137 |
abort (); |
138 |
#else |
138 |
#else |
139 |
pointer offset = obj->loc.offset; |
139 |
pointer offset = __atomic_load_n (&obj->loc.offset, __ATOMIC_ACQUIRE); |
140 |
|
140 |
|
141 |
if (__builtin_expect (offset == 0, 0)) |
141 |
if (__builtin_expect (offset == 0, 0)) |
142 |
{ |
142 |
{ |
Lines 147-153
__emutls_get_address (struct __emutls_object *obj)
Link Here
|
147 |
if (offset == 0) |
147 |
if (offset == 0) |
148 |
{ |
148 |
{ |
149 |
offset = ++emutls_size; |
149 |
offset = ++emutls_size; |
150 |
obj->loc.offset = offset; |
150 |
__atomic_store_n (&obj->loc.offset, offset, __ATOMIC_RELEASE); |
151 |
} |
151 |
} |
152 |
__gthread_mutex_unlock (&emutls_mutex); |
152 |
__gthread_mutex_unlock (&emutls_mutex); |
153 |
} |
153 |
} |