User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:api:xatmi:tpfreectxt.3

tpfreectxt

Name

tpfreectxt — Free the context data (TLS data)

Synopsis

#include <atmi.h>

void tpfreectxt(TPCONTEXT_T context);

Link with -latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm

DESCRIPTION

Function frees up the context data which was returned by tpgetctxt(3) function call. Function does not do the tpterm(3). Thus to remove context data fully, firstly thread running with context must call tpterm(3), then tpgetctxt(3) and then call tpfreectxt().

This function uses underlaying thread local storage infrastructure which is provided separately for each of the major Enduro/X libraries - libnstd (Standard library), libufb (UBF buffer library) and libatmi (ATMI library). If operations at library levels are required, then following functions can be used:

  1. ndrx_nstd_tls_new(), ndrx_ubf_tls_new(), ndrx_atmi_tls_new() - allocate TLS data for library.
  2. ndrx_nstd_tls_get(), ndrx_ubf_tls_get(), ndrx_atmi_tls_get() - get the TLS data for library (currently associated with thread).
  3. ndrx_nstd_tls_set(), ndrx_ubf_tls_set(), ndrx_atmi_tls_set() - set the thread local data from saved pointer.
  4. ndrx_nstd_tls_free(), ndrx_ubf_tls_free(), ndrx_atmi_tls_free() - free the thread local data.

Function call run in NULL context. If current TLS context equals to context then current thread is set to NULL context.

RETURN VALUE

N/A

ERRORS

N/A

EXAMPLE

See atmitest/test016_contextsw/atmiclt16.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd