aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-05 10:34:09 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-05 10:34:09 +0000
commit95d85de7d5eb11653e1060168904171238a85721 (patch)
tree0eacb7664f84c1b8b4a3dffcfd2eb501e56c8f8b /os/nil/src
parent867c7c95aa67ea1f19286c3593500214101bacd9 (diff)
downloadChibiOS-95d85de7d5eb11653e1060168904171238a85721.tar.gz
ChibiOS-95d85de7d5eb11653e1060168904171238a85721.tar.bz2
ChibiOS-95d85de7d5eb11653e1060168904171238a85721.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6263 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/nil/src')
-rw-r--r--os/nil/src/nil.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/os/nil/src/nil.c b/os/nil/src/nil.c
index 20b454fa8..692d72a3d 100644
--- a/os/nil/src/nil.c
+++ b/os/nil/src/nil.c
@@ -278,22 +278,22 @@ thread_reference_t chSchReadyI(thread_reference_t tr, msg_t msg) {
}
/**
- * @brief Reschedules.
+ * @brief Reschedules if needed.
*
* @sclass
*/
-void chSchRescheduleS() {
- thread_reference_t otr = nil.current;
- thread_reference_t ntr = nil.next;
+void chSchRescheduleS(void) {
- if (ntr != otr) {
- nil.current = ntr;
+ if (chSchIsRescRequiredI()) {
+ thread_reference_t otr = nil.current;
+
+ nil.current = nil.next;
#if defined(NIL_CFG_IDLE_LEAVE_HOOK)
if (otr == &nil.threads[NIL_CFG_NUM_THREADS]) {
NIL_CFG_IDLE_LEAVE_HOOK();
}
#endif
- port_switch(ntr, otr);
+ port_switch(nil.next, otr);
}
}