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))); \
340 tsrm_tls_entry *thread_resources; in ts_resource_ex() local
348 thread_resources = tsrm_tls_get(); in ts_resource_ex()
350 if (thread_resources) { in ts_resource_ex()
351 …EL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id)); in ts_resource_ex()
356 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
367 thread_resources = tsrm_tls_table[hash_value]; in ts_resource_ex()
369 if (!thread_resources) { in ts_resource_ex()
374 if (thread_resources->thread_id == thread_id) { in ts_resource_ex()
377 if (thread_resources->next) { in ts_resource_ex()
378 thread_resources = thread_resources->next; in ts_resource_ex()
380 allocate_new_resource(&thread_resources->next, thread_id); in ts_resource_ex()
387 } while (thread_resources); in ts_resource_ex()
394 TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); in ts_resource_ex()
401 tsrm_tls_entry *next, *thread_resources = (tsrm_tls_entry*)context; in tsrm_free_interpreter_context() local
404 while (thread_resources) { in tsrm_free_interpreter_context()
405 next = thread_resources->next; in tsrm_free_interpreter_context()
407 for (i=0; i<thread_resources->count; i++) { in tsrm_free_interpreter_context()
409 resource_types_table[i].dtor(thread_resources->storage[i]); in tsrm_free_interpreter_context()
412 for (i=0; i<thread_resources->count; i++) { in tsrm_free_interpreter_context()
413 free(thread_resources->storage[i]); in tsrm_free_interpreter_context()
415 free(thread_resources->storage); in tsrm_free_interpreter_context()
416 free(thread_resources); in tsrm_free_interpreter_context()
417 thread_resources = next; in tsrm_free_interpreter_context()
460 tsrm_tls_entry *thread_resources; in ts_free_thread() local
468 thread_resources = tsrm_tls_table[hash_value]; in ts_free_thread()
470 while (thread_resources) { in ts_free_thread()
471 if (thread_resources->thread_id == thread_id) { in ts_free_thread()
472 for (i=0; i<thread_resources->count; i++) { in ts_free_thread()
474 resource_types_table[i].dtor(thread_resources->storage[i]); in ts_free_thread()
477 for (i=0; i<thread_resources->count; i++) { in ts_free_thread()
478 free(thread_resources->storage[i]); in ts_free_thread()
480 free(thread_resources->storage); in ts_free_thread()
482 last->next = thread_resources->next; in ts_free_thread()
484 tsrm_tls_table[hash_value] = thread_resources->next; in ts_free_thread()
487 free(thread_resources); in ts_free_thread()
490 if (thread_resources->next) { in ts_free_thread()
491 last = thread_resources; in ts_free_thread()
493 thread_resources = thread_resources->next; in ts_free_thread()
502 tsrm_tls_entry *thread_resources; in ts_free_worker_threads() local
510 thread_resources = tsrm_tls_table[hash_value]; in ts_free_worker_threads()
512 while (thread_resources) { in ts_free_worker_threads()
513 if (thread_resources->thread_id != thread_id) { in ts_free_worker_threads()
514 for (i=0; i<thread_resources->count; i++) { in ts_free_worker_threads()
516 resource_types_table[i].dtor(thread_resources->storage[i]); in ts_free_worker_threads()
519 for (i=0; i<thread_resources->count; i++) { in ts_free_worker_threads()
520 free(thread_resources->storage[i]); in ts_free_worker_threads()
522 free(thread_resources->storage); in ts_free_worker_threads()
524 last->next = thread_resources->next; in ts_free_worker_threads()
526 tsrm_tls_table[hash_value] = thread_resources->next; in ts_free_worker_threads()
528 free(thread_resources); in ts_free_worker_threads()
530 thread_resources = last->next; in ts_free_worker_threads()
532 thread_resources = tsrm_tls_table[hash_value]; in ts_free_worker_threads()
535 if (thread_resources->next) { in ts_free_worker_threads()
536 last = thread_resources; in ts_free_worker_threads()
538 thread_resources = thread_resources->next; in ts_free_worker_threads()