The code should be
pObj->prd.numPendingCmd++; //First increment and then send cmd.
status = OSA_tskSendMsg(pTsk, NULL, SYSTEM_CMD_NEW_DATA, NULL, 0);
The code should be
pObj->prd.numPendingCmd++; //First increment and then send cmd.
status = OSA_tskSendMsg(pTsk, NULL, SYSTEM_CMD_NEW_DATA, NULL, 0);