Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Files

os.h/os_tls.c

Prototype

Code Block
void  OS_TLS_SetValue (OS_TCB     *p_tcb,
                       OS_TLS_ID   id,
                       OS_TLS      value,
                       OS_ERR     *p_err)

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].

...

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

Example Usage

Code Block
titleOS_TLS_SetValue() example usage
          OS_TLS_ID   MyTLS_ID;
           
           
          void MyTask (void *p_arg)
          {
              OS_ERR      err;
              OS_TLS      p_tls;
           
           
              :
              :
              while (DEF_TRUE) {
                  p_tls = OSTLS_GetValue((OS_TCB   *)0,
                                         (OS_TLS_ID)MyTLS_ID,
                                         (OS_ERR  *)&err);
                  /* Check "err" */
                  :
                  :
              }
          }