Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
void  OS_TLS_SetValue (OS_TCB    *p_tcb,
                       OS_TLS_ID  id,
                       OS_TLS     value,
                       OS_ERR    *p_err);

File

Called from

Code enabled by

os_tls.c

Task

OS_CFG_TLS_TBL_SIZE

...

Description

Sets the value of a TLS (thread-local storage) entry in the specified task’s OS_TCB. Specifically, this function assigns value to p_tcb->TLS_Tbl[id]. See Chapter 20, “Thread Safety of the Compiler’s Run-Time Library” for details on TLS.

Files

os.h/os_tls.c

Prototype

Arguments

p_tcb

is a pointer to the OS_TCB of the task you wish to assign the TLS value to. value will thus be assigned to p_tcb->TLS_Tbl[id].

...

If you called OS_TLS_SetValue() but the task was created with the option OS_OPT_TASK_NO_TLS indicating that the task does not need TLS support.

Returned Value

None

Required Configuration

OS_CFG_TLS_TBL_SIZE must be higher than 0 in os_cfg.h. Refer to uC-OS-III Configuration Manual

Callers

Application.

Notes/Warnings

  1. You cannot call OS_TLS_SetValue() for a task until that task gets created.

Example Usage