Lines Matching refs:thread_resources

87 						unshuffled_offset, (long) thread_resources->thread_id, array[unshuffled_offset]));				\
91 … unshuffled_offset, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1))); \
164 static void ts_free_resources(tsrm_tls_entry *thread_resources) in ts_free_resources() argument
167 for (int i = thread_resources->count - 1; i >= 0; i--) { in ts_free_resources()
170 resource_types_table[i].dtor(thread_resources->storage[i]); in ts_free_resources()
174 free(thread_resources->storage[i]); in ts_free_resources()
179 free(thread_resources->storage); in ts_free_resources()
421 tsrm_tls_entry *thread_resources, **last_thread_resources; in ts_resource_ex() local
429 thread_resources = tsrm_tls_get(); in ts_resource_ex()
431 if (thread_resources) { in ts_resource_ex()
432 …EL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id)); in ts_resource_ex()
437 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
448 thread_resources = tsrm_tls_table[hash_value]; in ts_resource_ex()
450 if (!thread_resources) { in ts_resource_ex()
456 while (thread_resources->thread_id != thread_id) { in ts_resource_ex()
457 last_thread_resources = &thread_resources->next; in ts_resource_ex()
458 if (thread_resources->next) { in ts_resource_ex()
459 thread_resources = thread_resources->next; in ts_resource_ex()
461 allocate_new_resource(&thread_resources->next, thread_id); in ts_resource_ex()
482 TSRM_ASSERT(thread_resources->thread_id == thread_id); in ts_resource_ex()
484 tsrm_tls_entry *next = thread_resources->next; in ts_resource_ex()
487 set_thread_local_storage_resource_to(thread_resources); in ts_resource_ex()
489 ts_free_resources(thread_resources); in ts_resource_ex()
490 free(thread_resources); in ts_resource_ex()
493 thread_resources = *last_thread_resources; in ts_resource_ex()
494 thread_resources->next = next; in ts_resource_ex()
505 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
512 tsrm_tls_entry *thread_resources; in ts_free_thread() local
521 thread_resources = tsrm_tls_table[hash_value]; in ts_free_thread()
523 while (thread_resources) { in ts_free_thread()
524 if (thread_resources->thread_id == thread_id) { in ts_free_thread()
525 ts_free_resources(thread_resources); in ts_free_thread()
527 last->next = thread_resources->next; in ts_free_thread()
529 tsrm_tls_table[hash_value] = thread_resources->next; in ts_free_thread()
532 free(thread_resources); in ts_free_thread()
535 if (thread_resources->next) { in ts_free_thread()
536 last = thread_resources; in ts_free_thread()
538 thread_resources = thread_resources->next; in ts_free_thread()