mirror of https://github.com/ARMmbed/mbed-os.git
[RTOS] Fixed osThreadGetState()
Fixed regression that caused terminated threads to return an erroneous state value instead of "inactive".pull/1731/head
parent
3210b40a91
commit
a2bfca7527
|
@ -905,7 +905,7 @@ uint8_t osThreadGetState (osThreadId thread_id) {
|
|||
if (__exceptional_mode()) return osErrorISR; // Not allowed in ISR
|
||||
|
||||
ptcb = rt_tid2ptcb(thread_id); // Get TCB pointer
|
||||
if (ptcb == NULL) return osErrorParameter;
|
||||
if (ptcb == NULL) return INACTIVE;
|
||||
|
||||
return ptcb->state;
|
||||
}
|
||||
|
|
|
@ -842,7 +842,7 @@ uint8_t osThreadGetState (osThreadId thread_id) {
|
|||
if (__get_IPSR() != 0U) return osErrorISR; // Not allowed in ISR
|
||||
|
||||
ptcb = rt_tid2ptcb(thread_id); // Get TCB pointer
|
||||
if (ptcb == NULL) return osErrorParameter;
|
||||
if (ptcb == NULL) return INACTIVE;
|
||||
|
||||
return ptcb->state;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue