| 51 | |
| 52 | static acl_pthread_once_t once_control = ACL_PTHREAD_ONCE_INIT; |
| 53 | static void *tls_calloc(size_t len) |
| 54 | { |
| 55 | void *ptr; |
| 56 | |
| 57 | (void) acl_pthread_once(&once_control, once_init); |
| 58 | ptr = (void*) acl_pthread_getspecific(once_key); |
| 59 | if (ptr == NULL) { |
| 60 | ptr = acl_mycalloc(1, len); |
| 61 | acl_pthread_setspecific(once_key, ptr); |
| 62 | if ((unsigned long) acl_pthread_self() == acl_main_thread_self()) |
| 63 | __tls = ptr; |
| 64 | } |
| 65 | return ptr; |
| 66 | } |
| 67 | |
| 68 | typedef struct { |
| 69 | struct timeval stamp; |
no test coverage detected
searching dependent graphs…