/* glpenv02.c (thread local storage) */ /* (reserved for copyright notice) */ #include #include "glpenv.h" /* re-enterable POSIX version */ pthread_key_t _glp_pth_key; /* must be initialized in the main program */ void tls_set_ptr(void *ptr) { pthread_setspecific(_glp_pth_key, ptr); return; } void *tls_get_ptr(void) { void *ptr; ptr = pthread_getspecific(_glp_pth_key); return ptr; } /* eof */