nuttx/sched: merge up_block_task and up_unblock_task

This commit is contained in:
zhangyuan21
2022-11-15 16:52:40 +08:00
committed by Xiang Xiao
parent 25bfd437fe
commit d8051ba979
91 changed files with 222 additions and 2473 deletions
+2 -2
View File
@@ -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);
}
}
+2 -2
View File
@@ -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);
}
}
+1 -1
View File
@@ -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);
}
}
+2 -2
View File
@@ -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);
}
}
+2 -2
View File
@@ -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);
}
}
}