Lines Matching refs:thread_resources

79 						unshuffled_offset, (long) thread_resources->thread_id, array[unshuffled_offset]));				\
83 … unshuffled_offset, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1))); \
335 tsrm_tls_entry *thread_resources; in ts_resource_ex() local
343 thread_resources = tsrm_tls_get(); in ts_resource_ex()
345 if (thread_resources) { in ts_resource_ex()
346 …EL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id)); in ts_resource_ex()
351 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
362 thread_resources = tsrm_tls_table[hash_value]; in ts_resource_ex()
364 if (!thread_resources) { in ts_resource_ex()
369 if (thread_resources->thread_id == thread_id) { in ts_resource_ex()
372 if (thread_resources->next) { in ts_resource_ex()
373 thread_resources = thread_resources->next; in ts_resource_ex()
375 allocate_new_resource(&thread_resources->next, thread_id); in ts_resource_ex()
382 } while (thread_resources); in ts_resource_ex()
389 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
396 tsrm_tls_entry *next, *thread_resources = (tsrm_tls_entry*)context; in tsrm_free_interpreter_context() local
399 while (thread_resources) { in tsrm_free_interpreter_context()
400 next = thread_resources->next; in tsrm_free_interpreter_context()
402 for (i=0; i<thread_resources->count; i++) { in tsrm_free_interpreter_context()
404 resource_types_table[i].dtor(thread_resources->storage[i]); in tsrm_free_interpreter_context()
407 for (i=0; i<thread_resources->count; i++) { in tsrm_free_interpreter_context()
408 free(thread_resources->storage[i]); in tsrm_free_interpreter_context()
410 free(thread_resources->storage); in tsrm_free_interpreter_context()
411 free(thread_resources); in tsrm_free_interpreter_context()
412 thread_resources = next; in tsrm_free_interpreter_context()
455 tsrm_tls_entry *thread_resources; in ts_free_thread() local
463 thread_resources = tsrm_tls_table[hash_value]; in ts_free_thread()
465 while (thread_resources) { in ts_free_thread()
466 if (thread_resources->thread_id == thread_id) { in ts_free_thread()
467 for (i=0; i<thread_resources->count; i++) { in ts_free_thread()
469 resource_types_table[i].dtor(thread_resources->storage[i]); in ts_free_thread()
472 for (i=0; i<thread_resources->count; i++) { in ts_free_thread()
473 free(thread_resources->storage[i]); in ts_free_thread()
475 free(thread_resources->storage); in ts_free_thread()
477 last->next = thread_resources->next; in ts_free_thread()
479 tsrm_tls_table[hash_value] = thread_resources->next; in ts_free_thread()
482 free(thread_resources); in ts_free_thread()
485 if (thread_resources->next) { in ts_free_thread()
486 last = thread_resources; in ts_free_thread()
488 thread_resources = thread_resources->next; in ts_free_thread()
497 tsrm_tls_entry *thread_resources; in ts_free_worker_threads() local
505 thread_resources = tsrm_tls_table[hash_value]; in ts_free_worker_threads()
507 while (thread_resources) { in ts_free_worker_threads()
508 if (thread_resources->thread_id != thread_id) { in ts_free_worker_threads()
509 for (i=0; i<thread_resources->count; i++) { in ts_free_worker_threads()
511 resource_types_table[i].dtor(thread_resources->storage[i]); in ts_free_worker_threads()
514 for (i=0; i<thread_resources->count; i++) { in ts_free_worker_threads()
515 free(thread_resources->storage[i]); in ts_free_worker_threads()
517 free(thread_resources->storage); in ts_free_worker_threads()
519 last->next = thread_resources->next; in ts_free_worker_threads()
521 tsrm_tls_table[hash_value] = thread_resources->next; in ts_free_worker_threads()
523 free(thread_resources); in ts_free_worker_threads()
525 thread_resources = last->next; in ts_free_worker_threads()
527 thread_resources = tsrm_tls_table[hash_value]; in ts_free_worker_threads()
530 if (thread_resources->next) { in ts_free_worker_threads()
531 last = thread_resources; in ts_free_worker_threads()
533 thread_resources = thread_resources->next; in ts_free_worker_threads()