25 lock_tls_blocks_ =
reinterpret_cast<pthread_mutex_t *
>(
26 smalloc(
sizeof(pthread_mutex_t)));
27 int retval = pthread_mutex_init(lock_tls_blocks_, NULL);
33 pthread_mutex_destroy(lock_tls_blocks_);
34 free(lock_tls_blocks_);
36 for (
unsigned i = 0; i < tls_blocks_.size(); ++i) {
37 delete tls_blocks_[i];
40 int retval = pthread_key_delete(thread_local_storage_);
46 if (instance_ == NULL) {
49 pthread_key_create(&instance_->thread_local_storage_, TlsDestructor);
59 pthread_getspecific(thread_local_storage_));
60 if ((tls == NULL) || !tls->
is_set) {
76 pthread_getspecific(thread_local_storage_));
86 pthread_getspecific(thread_local_storage_));
90 int retval = pthread_setspecific(thread_local_storage_, tls);
93 tls_blocks_.push_back(tls);
110 for (vector<ThreadLocalStorage *>::iterator i =
111 instance_->tls_blocks_.begin(), iEnd = instance_->tls_blocks_.end();
115 instance_->tls_blocks_.erase(i);
124 pthread_getspecific(thread_local_storage_));
bool is_set
either not yet set or deliberately unset
void Get(uid_t *uid, gid_t *gid, pid_t *pid, InterruptCue **ic)
static ClientCtx * instance_
assert((mem||(size==0))&&"Out Of Memory")
InterruptCue * interrupt_cue
A non-owning pointer.
static void TlsDestructor(void *data)
void Set(uid_t uid, gid_t gid, pid_t pid, InterruptCue *ic)
static void CleanupInstance()
static ClientCtx * GetInstance()