Lines Matching refs:thread_resources

74 						unshuffled_offset, (long) thread_resources->thread_id, array[unshuffled_offset]));				\
78 … unshuffled_offset, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1))); \
312 tsrm_tls_entry *thread_resources; in ts_resource_ex() local
329 thread_resources = tsrm_tls_get(); in ts_resource_ex()
331 if (thread_resources) { in ts_resource_ex()
332 …EL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id)); in ts_resource_ex()
337 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
348 thread_resources = tsrm_tls_table[hash_value]; in ts_resource_ex()
350 if (!thread_resources) { in ts_resource_ex()
355 if (thread_resources->thread_id == thread_id) { in ts_resource_ex()
358 if (thread_resources->next) { in ts_resource_ex()
359 thread_resources = thread_resources->next; in ts_resource_ex()
361 allocate_new_resource(&thread_resources->next, thread_id); in ts_resource_ex()
368 } while (thread_resources); in ts_resource_ex()
375 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
385 tsrm_tls_entry *next, *thread_resources = (tsrm_tls_entry*)context; in tsrm_free_interpreter_context() local
388 while (thread_resources) { in tsrm_free_interpreter_context()
389 next = thread_resources->next; in tsrm_free_interpreter_context()
391 for (i=0; i<thread_resources->count; i++) { in tsrm_free_interpreter_context()
393 resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage); in tsrm_free_interpreter_context()
396 for (i=0; i<thread_resources->count; i++) { in tsrm_free_interpreter_context()
397 free(thread_resources->storage[i]); in tsrm_free_interpreter_context()
399 free(thread_resources->storage); in tsrm_free_interpreter_context()
400 free(thread_resources); in tsrm_free_interpreter_context()
401 thread_resources = next; in tsrm_free_interpreter_context()
444 tsrm_tls_entry *thread_resources; in ts_free_thread() local
452 thread_resources = tsrm_tls_table[hash_value]; in ts_free_thread()
454 while (thread_resources) { in ts_free_thread()
455 if (thread_resources->thread_id == thread_id) { in ts_free_thread()
456 for (i=0; i<thread_resources->count; i++) { in ts_free_thread()
458 resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage); in ts_free_thread()
461 for (i=0; i<thread_resources->count; i++) { in ts_free_thread()
462 free(thread_resources->storage[i]); in ts_free_thread()
464 free(thread_resources->storage); in ts_free_thread()
466 last->next = thread_resources->next; in ts_free_thread()
468 tsrm_tls_table[hash_value] = thread_resources->next; in ts_free_thread()
471 free(thread_resources); in ts_free_thread()
474 if (thread_resources->next) { in ts_free_thread()
475 last = thread_resources; in ts_free_thread()
477 thread_resources = thread_resources->next; in ts_free_thread()
486 tsrm_tls_entry *thread_resources; in ts_free_worker_threads() local
494 thread_resources = tsrm_tls_table[hash_value]; in ts_free_worker_threads()
496 while (thread_resources) { in ts_free_worker_threads()
497 if (thread_resources->thread_id != thread_id) { in ts_free_worker_threads()
498 for (i=0; i<thread_resources->count; i++) { in ts_free_worker_threads()
500 resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage); in ts_free_worker_threads()
503 for (i=0; i<thread_resources->count; i++) { in ts_free_worker_threads()
504 free(thread_resources->storage[i]); in ts_free_worker_threads()
506 free(thread_resources->storage); in ts_free_worker_threads()
508 last->next = thread_resources->next; in ts_free_worker_threads()
510 tsrm_tls_table[hash_value] = thread_resources->next; in ts_free_worker_threads()
512 free(thread_resources); in ts_free_worker_threads()
514 thread_resources = last->next; in ts_free_worker_threads()
516 thread_resources = tsrm_tls_table[hash_value]; in ts_free_worker_threads()
519 if (thread_resources->next) { in ts_free_worker_threads()
520 last = thread_resources; in ts_free_worker_threads()
522 thread_resources = thread_resources->next; in ts_free_worker_threads()