New empth_name() and empth_set_name()

This commit is contained in:
Ron Koenderink 2008-09-11 14:46:31 -06:00
parent 2e5915dd09
commit 2ddeda99d0
6 changed files with 88 additions and 0 deletions

View file

@ -247,6 +247,25 @@ empth_self(void)
return pthread_getspecific(ctx_key);
}
char *
empth_name(void)
{
return empth_self()->name;
}
void
empth_set_name(char *name)
{
empth_t *ctx_ptr;
ctx_ptr = pthread_getspecific(ctx_key);
if (ctx_ptr->name != NULL)
free(ctx_ptr->name);
ctx_ptr->name = strdup(name);
}
void
empth_exit(void)
{