]> gitweb.factorcode.org Git - factor.git/blob - vm/mvm-unix.cpp
Put brackets around ipv6 addresses in `inet6 present`
[factor.git] / vm / mvm-unix.cpp
1 #include "master.hpp"
2
3 namespace factor {
4
5 pthread_key_t current_vm_tls_key;
6
7 void init_mvm() {
8   if (pthread_key_create(&current_vm_tls_key, NULL) != 0)
9     fatal_error("pthread_key_create() failed", 0);
10 }
11
12 void register_vm_with_thread(factor_vm* vm) {
13   pthread_setspecific(current_vm_tls_key, vm);
14 }
15
16 factor_vm* current_vm_p() {
17   return (factor_vm*)pthread_getspecific(current_vm_tls_key);
18 }
19
20 }