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()
427 tsrm_tls_entry *thread_resources, **last_thread_resources; in ts_resource_ex() local
435 thread_resources = tsrm_tls_get(); in ts_resource_ex()
437 if (thread_resources) { in ts_resource_ex()
438 …EL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id)); in ts_resource_ex()
443 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
454 thread_resources = tsrm_tls_table[hash_value]; in ts_resource_ex()
456 if (!thread_resources) { in ts_resource_ex()
462 while (thread_resources->thread_id != thread_id) { in ts_resource_ex()
463 last_thread_resources = &thread_resources->next; in ts_resource_ex()
464 if (thread_resources->next) { in ts_resource_ex()
465 thread_resources = thread_resources->next; in ts_resource_ex()
467 allocate_new_resource(&thread_resources->next, thread_id); in ts_resource_ex()
488 TSRM_ASSERT(thread_resources->thread_id == thread_id); in ts_resource_ex()
490 tsrm_tls_entry *next = thread_resources->next; in ts_resource_ex()
493 set_thread_local_storage_resource_to(thread_resources); in ts_resource_ex()
495 ts_free_resources(thread_resources); in ts_resource_ex()
496 free(thread_resources); in ts_resource_ex()
499 thread_resources = *last_thread_resources; in ts_resource_ex()
500 thread_resources->next = next; in ts_resource_ex()
511 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
518 tsrm_tls_entry *thread_resources; in ts_free_thread() local
527 thread_resources = tsrm_tls_table[hash_value]; in ts_free_thread()
529 while (thread_resources) { in ts_free_thread()
530 if (thread_resources->thread_id == thread_id) { in ts_free_thread()
531 ts_free_resources(thread_resources); in ts_free_thread()
533 last->next = thread_resources->next; in ts_free_thread()
535 tsrm_tls_table[hash_value] = thread_resources->next; in ts_free_thread()
538 free(thread_resources); in ts_free_thread()
541 if (thread_resources->next) { in ts_free_thread()
542 last = thread_resources; in ts_free_thread()
544 thread_resources = thread_resources->next; in ts_free_thread()