void ub_thread_key_create(ub_thread_key_t* key, void* f) { *key = TlsAlloc(); if(*key == TLS_OUT_OF_INDEXES) { *key = 0; log_win_err("TlsAlloc Failed(OUT_OF_INDEXES)", GetLastError()); } else ub_thread_key_set(*key, f); }
void log_thread_set(int* num) { ub_thread_key_set(logkey, num); }