pth_get_pool

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
LICENSE
VERSION

NAME

pth_get_pool, pth_get_name, pth_get_thread_num, pth_get_run, pth_get_data, pth_get_language, pth_get_tz, pth_get_stack, pth_get_stack_size, pth_get_PC, pth_get_SP, pth_set_name, pth_set_language, pth_set_tz - get and set status of pseudothreads

SYNOPSIS

#include <pthr_pseudothread.h>

pool pth_get_pool (pseudothread pth);
const char *pth_get_name (pseudothread pth);
int pth_get_thread_num (pseudothread pth);
void (*pth_get_run (pseudothread pth)) (void *);
void *pth_get_data (pseudothread pth);
const char *pth_get_language (pseudothread pth);
const char *pth_get_tz (pseudothread pth);
void *pth_get_stack (pseudothread pth);
int pth_get_stack_size (pseudothread pth);
unsigned long pth_get_PC (pseudothread pth);
unsigned long pth_get_SP (pseudothread pth);
void pth_set_name (pseudothread pth, const char *name);
void pth_set_language (pseudothread, const char *lang);
void pth_set_tz (pseudothread, const char *tz);

DESCRIPTION

pth_get_pool returns the pool associated with this thread. The thread should use this pool for all allocations, ensuring that they are cleaned up correctly when the thread is deleted. See new_pool(3).
pth_get_name returns the name of the thread. Note that this string is normally stored in thread's local pool, and therefore the string memory may be unexpected deallocated if the thread exits. Callers should take a copy of the string in their own pool if they are likely to need the string for a long period of time.
pth_get_thread_num returns the thread number (roughly the equivalent of a process ID).
pth_get_run and pth_get_data return the original entry point information of the thread.
pth_get_language returns the value of the LANGUAGE environment variable for this thread. See the discussion of pth_set_language below.
pth_get_language returns the value of the TZ environment variable for this thread. See the discussion of pth_set_tz below.
pth_get_stack returns the top of the stack for this thread.
pth_get_stack_size returns the maximum size of the stack for this thread.
pth_get_PC returns the current program counter (PC) for this thread. Obviously it only makes sense to call this from another thread.
pth_get_SP returns the current stack pointer (SP) for this thread. Obviously it only makes sense to call this from another thread.
pth_set_name changes the name of the thread. The string name argument passed must be either statically allocated, or allocated in the thread's own pool (the normal case), or else allocated in another pool with a longer life than the current thread.
pth_set_language changes the per-thread LANGUAGE environment variable. This is useful when serving clients from multiple locales, and using GNU gettext for translation.
pth_set_tz changes the per-thread TZ environment variable. This is useful when serving clients from multiple timezones, and using localtime and related functions.

AUTHOR

Richard Jones <rich@annexia.org>

LICENSE

GNU LGPL (see http://www.gnu.org/)

VERSION

pthrlib-3.0.3