Changeset 701dd96f in rtems for cpukit/score/include/rtems

Timestamp:
06/12/14 12:37:57 (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
a80c3b6
Parents:
970aa80
git-author:
Sebastian Huber <sebastian.huber@…> (06/12/14 12:37:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/12/14 14:13:26)
Message:

score: PR2181: Add _Thread_Yield()

The _Scheduler_Yield() was called by the executing thread with thread
dispatching disabled and interrupts enabled. The rtems_task_suspend()
is explicitly allowed in ISRs:

http://rtems.org/onlinedocs/doc-current/share/rtems/html/c_user/Interrupt-Manager-Directives-Allowed-from-an-ISR.html#Interrupt-Manager-Directives-Allowed-from-an-ISR

Unlike the other scheduler operations the locking was performed inside
the operation. This lead to the following race condition. Suppose a
ISR suspends the executing thread right before the yield scheduler
operation. Now the executing thread is not longer in the set of ready
threads. The typical scheduler operations did not check the thread
state and will now extract the thread again and enqueue it. This
corrupted data structures.

Add _Thread_Yield() and do the scheduler yield operation with interrupts
disabled. This has a negligible effect on the interrupt latency.

(No files)

Note: See TracChangeset for help on using the changeset viewer.