mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
nuttx/sched: merge up_block_task and up_unblock_task
This commit is contained in:
@@ -197,7 +197,7 @@ int nxmq_wait_receive(FAR struct mqueue_inode_s *msgq,
|
||||
|
||||
if (switch_needed)
|
||||
{
|
||||
up_block_task(rtcb);
|
||||
up_switch_context(this_task(), rtcb);
|
||||
}
|
||||
|
||||
/* When we resume at this point, either (1) the message queue
|
||||
@@ -330,7 +330,7 @@ ssize_t nxmq_do_receive(FAR struct mqueue_inode_s *msgq,
|
||||
|
||||
if (nxsched_add_readytorun(btcb))
|
||||
{
|
||||
up_unblock_task(btcb, rtcb);
|
||||
up_switch_context(btcb, rtcb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ int nxmq_wait_send(FAR struct mqueue_inode_s *msgq, int oflags)
|
||||
|
||||
if (switch_needed)
|
||||
{
|
||||
up_block_task(rtcb);
|
||||
up_switch_context(this_task(), rtcb);
|
||||
}
|
||||
|
||||
/* When we resume at this point, either (1) the message queue
|
||||
@@ -436,7 +436,7 @@ int nxmq_do_send(FAR struct mqueue_inode_s *msgq,
|
||||
|
||||
if (nxsched_add_readytorun(btcb))
|
||||
{
|
||||
up_unblock_task(btcb, rtcb);
|
||||
up_switch_context(btcb, rtcb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,6 @@ void nxmq_wait_irq(FAR struct tcb_s *wtcb, int errcode)
|
||||
|
||||
if (nxsched_add_readytorun(wtcb))
|
||||
{
|
||||
up_unblock_task(wtcb, rtcb);
|
||||
up_switch_context(wtcb, rtcb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ static int msgrcv_wait(FAR struct msgq_s *msgq, FAR struct msgbuf_s **rcvmsg,
|
||||
|
||||
if (switch_needed)
|
||||
{
|
||||
up_block_task(rtcb);
|
||||
up_switch_context(this_task(), rtcb);
|
||||
}
|
||||
|
||||
/* When we resume at this point, either (1) the message queue
|
||||
@@ -271,7 +271,7 @@ ssize_t msgrcv(int msqid, FAR void *msgp, size_t msgsz, long msgtyp,
|
||||
|
||||
if (nxsched_add_readytorun(btcb))
|
||||
{
|
||||
up_unblock_task(btcb, rtcb);
|
||||
up_switch_context(btcb, rtcb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ static int msgsnd_wait(FAR struct msgq_s *msgq, int msgflg)
|
||||
|
||||
if (switch_needed)
|
||||
{
|
||||
up_block_task(rtcb);
|
||||
up_switch_context(this_task(), rtcb);
|
||||
}
|
||||
|
||||
/* When we resume at this point, either (1) the message queue
|
||||
@@ -264,7 +264,7 @@ int msgsnd(int msqid, FAR const void *msgp, size_t msgsz, int msgflg)
|
||||
|
||||
if (nxsched_add_readytorun(btcb))
|
||||
{
|
||||
up_unblock_task(btcb, rtcb);
|
||||
up_switch_context(btcb, rtcb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user