forked from xuos/xiuos
repair the timeout for sem and mutex
This commit is contained in:
parent
587c2d595e
commit
afc4b58b74
|
@ -96,7 +96,12 @@ static x_err_t _MsgQueueSend(struct MsgQueue *mq,
|
|||
|
||||
tick_delta = 0;
|
||||
task = GetKTaskDescriptor();
|
||||
timeout = CalculteTickFromTimeMs(msec);
|
||||
|
||||
if(WAITING_FOREVER == msec)
|
||||
timeout = WAITING_FOREVER;
|
||||
else
|
||||
timeout = CalculteTickFromTimeMs(msec);
|
||||
|
||||
lock = CriticalAreaLock();
|
||||
if (mq->num_msgs >= mq->max_msgs && timeout == 0) {
|
||||
CriticalAreaUnLock(lock);
|
||||
|
|
|
@ -94,8 +94,12 @@ static int32 _SemaphoreObtain(struct Semaphore *sem, int32 msec)
|
|||
struct TaskDescriptor *task = NONE;
|
||||
|
||||
NULL_PARAM_CHECK(sem);
|
||||
|
||||
wait_time = CalculteTickFromTimeMs(msec);
|
||||
|
||||
if(WAITING_FOREVER == msec)
|
||||
wait_time = WAITING_FOREVER;
|
||||
else
|
||||
wait_time = CalculteTickFromTimeMs(msec);
|
||||
|
||||
lock = CriticalAreaLock();
|
||||
|
||||
SYS_KDEBUG_LOG(KDBG_IPC, ("obtain semaphore: id %d, value %d, by task %s\n",
|
||||
|
|
Loading…
Reference in New Issue