This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: WidgetMutexGet Being Preempted?

Part Number: TM4C1294NCPDT

The grlib in TivaWare has the following mutex function in widget.c.  Isn't it possible it could fail due to an interrupt occurring after the ldrexb instruction but before the following cmp instruction?

#if defined(ewarm) || defined(DOXYGEN)
uint32_t
WidgetMutexGet(uint8_t *pi8Mutex)
{
    //
    // Acquire the mutex if possible.
    //
    __asm("    mov     r1, #1\n"
          "    ldrexb  r2, [r0]\n"
          "    cmp     r2, #0\n"
          "    it      eq\n"
          "    strexb  r2, r1, [r0]\n"
          "    mov     r0, r2\n");

    //
    // "Warning[Pe940]: missing return statement at end of non-void function"
    // is suppressed here to avoid putting a "bx lr" in the inline assembly
    // above and a superfluous return statement here.
    //
#pragma diag_suppress=Pe940
}
#pragma diag_default=Pe940
#endif