Next: 4.10.41 xep Up: 4.10 Classes Previous: 4.10.39 thd Contents Index
Subsections

- 4.10.40.1 API

##
4.10.40 tsd

The tsd class implements thread-specific data. A tsd instance can be created, then any number of threads can use that same instance to store and retrieve a thread-specific pointer to data.

### 4.10.40.1 API

void tsd_new(cw_tsd_t *a_tsd, void (*a_func)(void *)):

  Input(s):
    a_tsd:
      Pointer to space for a tsd.
    a_func:
      Pointer to a cleanup function, or NULL.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Constructor.

void tsd_delete(cw_tsd_t *a_tsd):

  Input(s):
    a_tsd:
      Pointer to a tsd.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Destructor.

void * tsd_get(cw_tsd_t *a_tsd):

  Input(s):
    a_tsd:
      Pointer to a tsd.
  Output(s):
    retval:
      Pointer to thread-specific data.
  Exception(s):
    None.
  Description:
    Get thread-specific data pointer.

void tsd_set(cw_tsd_t *a_tsd, void *a_val):

  Input(s):
    a_tsd:
      Pointer to a tsd.
    a_val:
      Pointer to thread-specific data.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Set thread-specific data pointer.

Next: 4.10.41 xep Up: 4.10 Classes Previous: 4.10.39 thd Contents Index