5 pthread_key_t current_vm_tls_key
;
8 if (pthread_key_create(¤t_vm_tls_key
, NULL
) != 0)
9 fatal_error("pthread_key_create() failed", 0);
12 void register_vm_with_thread(factor_vm
* vm
) {
13 pthread_setspecific(current_vm_tls_key
, vm
);
16 factor_vm
* current_vm_p() {
17 return (factor_vm
*)pthread_getspecific(current_vm_tls_key
);