Changed some thread_reference_t in thread_t *

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8233 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
Giovanni Di Sirio 2015-08-22 09:10:11 +00:00
parent d8366c2bf5
commit eec9281e9f
1 changed files with 13 additions and 13 deletions

View File

@ -60,20 +60,20 @@ void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg) {
semaphore_t *sp = &tqp->sem;
if (chSemGetCounterI(&tqp->sem) < (cnt_t)0) {
thread_reference_t tr = nil.threads;
thread_t *tp = nil.threads;
while (true) {
/* Is this thread waiting on this semaphore?*/
if (tr->u1.semp == sp) {
if (tp->u1.semp == sp) {
sp->cnt++;
chDbgAssert(NIL_THD_IS_WTSEM(tr), "not waiting");
chDbgAssert(NIL_THD_IS_WTSEM(tp), "not waiting");
(void) chSchReadyI(tr, msg);
(void) chSchReadyI(tp, msg);
return;
}
tr++;
tp++;
chDbgAssert(tr < &nil.threads[NIL_CFG_NUM_THREADS],
chDbgAssert(tp < &nil.threads[NIL_CFG_NUM_THREADS],
"pointer out of range");
}
}
@ -89,26 +89,26 @@ void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg) {
*/
void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) {
semaphore_t *sp = &tqp->sem;
thread_reference_t tr;
thread_t *tp;
cnt_t cnt;
cnt = sp->cnt;
sp->cnt = (cnt_t)0;
tr = nil.threads;
tp = nil.threads;
while (cnt < (cnt_t)0) {
chDbgAssert(tr < &nil.threads[NIL_CFG_NUM_THREADS],
chDbgAssert(tp < &nil.threads[NIL_CFG_NUM_THREADS],
"pointer out of range");
/* Is this thread waiting on this semaphore?*/
if (tr->u1.semp == sp) {
if (tp->u1.semp == sp) {
chDbgAssert(NIL_THD_IS_WTSEM(tr), "not waiting");
chDbgAssert(NIL_THD_IS_WTSEM(tp), "not waiting");
cnt++;
(void) chSchReadyI(tr, msg);
(void) chSchReadyI(tp, msg);
}
tr++;
tp++;
}
}