| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Delete global variables _Priority_Major_bit_map and _Priority_Bit_map.
This makes it possible to use multiple priority scheduler instances for
example with clustered/partitioned scheduling on SMP.
|
|
|
|
| |
Rename Priority_bit_map_Control in Priority_bit_map_Word.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue a fatal error in case a thread is deleted which still owns
resources (e.g. a binary semaphore with priority inheritance or ceiling
protocol). The resource count must be checked quite late since RTEMS
task variable destructors, POSIX key destructors, POSIX cleanup handler,
the Newlib thread termination extension or other thread termination
extensions may release resources. In this context it would be quite
difficult to return an error status to the caller.
An alternative would be to place threads with a non-zero resource count
not on the zombie chain. Thus we have a resource leak instead of a
fatal error. The terminator thread can see this error if we return an
RTEMS_RESOURCE_IN_USE status for the rtems_task_delete() for example.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add _Thread_queue_Extract_with_return_code(). On SMP this sequence in
_Thread_queue_Process_timeout() was broken:
[...]
/*
* After we enable interrupts here, a lot may happen in the
* meantime, e.g. nested interrupts may release the resource that
* times out here. So we enter _Thread_queue_Extract()
* speculatively. Inside this function we check the actual status
* under ISR disable protection. This ensures that exactly one
* executing context performs the extract operation (other parties
* may call _Thread_queue_Dequeue()). If this context won, then
* we have a timeout.
*
* We can use the_thread_queue pointer here even if
* the_thread->Wait.queue is already set to NULL since the extract
* operation will only use the thread queue discipline to select
* the right extract operation. The timeout status is set during
* thread queue initialization.
*/
we_did_it = _Thread_queue_Extract( the_thread_queue, the_thread );
if ( we_did_it ) {
the_thread->Wait.return_code = the_thread_queue->timeout_status;
}
[...]
In case _Thread_queue_Extract() successfully extracted a thread, then
this thread may start execution on a remote processor immediately and
read the the_thread->Wait.return_code before we update it here with the
timeout status. Thus it observes a successful operation even if it
timed out.
|
|
|
|
| |
Drop the return status, since it is nowhere used.
|
|
|
|
|
|
|
|
| |
The holder field is enough to determine if a mutex is locked or not.
This leads also to better error status codes in case a
rtems_semaphore_release() is done for a mutex without having the
ownership.
|
|
|
|
| |
We can use the holder pointer to get the identifier if necessary.
|
| |
|
|
|
|
|
|
|
| |
This fixes an integer underflow problem in case resources are released
after a thread restart.
Add new test sptests/spthreadlife01.
|
|
|
|
|
| |
Use allocator mutex for objects allocate/free. This prevents that the
thread dispatch latency depends on the workspace/heap fragmentation.
|
|
|
|
|
| |
This prevents that asynchronous thread deletion can lead to an unusable
allocator or once mutex.
|
|
|
|
|
| |
It is no longer necessary to protect the workspace allocations with the
Giant lock due to the thread life cycle re-implementation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The thread deletion is now supported on SMP.
This change fixes the following PRs:
PR1814: SMP race condition between stack free and dispatch
PR2035: psxcancel reveals NULL pointer access in _Thread_queue_Extract()
The POSIX cleanup handler are now called in the right context (should be
called in the context of the terminating thread).
http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html
Add a user extension the reflects a thread termination event. This is
used to reclaim the Newlib reentrancy structure (may use file
operations), the POSIX cleanup handlers and the POSIX key destructors.
|
|
|
|
|
| |
Replace _Thread_Reset() with _Thread_Start_life_change(). This function
can be later used for the _Thread_Close() implementation.
|
|
|
|
|
| |
The executing thread will be later used for a common implementation with
_Thread_Close().
|
|
|
|
|
| |
Run the thread restart extensions in the context of the restarted
thread. Run them with thread dispatching enabled.
|
|
|
|
|
| |
Move thread entry parameters out of _Thread_Reset() to enable
re-usablity of this function.
|
| |
|
|
|
|
|
| |
The thread restart is now supported on SMP. New test
smptests/smpthreadlife01.
|
|
|
|
| |
Use thread post-switch actions instead.
|
|
|
|
|
|
|
|
|
|
| |
Thread actions are the building block for efficient implementation of
- Classic signals delivery,
- POSIX signals delivery,
- thread restart notification,
- thread delete notification,
- forced thread migration on SMP configurations, and
- the Multiprocessor Resource Sharing Protocol (MrsP).
|
| |
|
|
|
|
| |
Add _Scheduler_Set_priority_if_higher().
|
|
|
|
|
|
| |
Use inline functions instead of macros for
_Scheduler_Is_priority_lower_than() and
_Scheduler_Is_priority_higher_than().
|
|
|
|
| |
Avoid NULL pointer access.
|
|
|
|
|
| |
Add _Per_CPU_State_wait_for_ready_to_start_multitasking(). Add new
fatal SMP error SMP_FATAL_SHUTDOWN_EARLY.
|
|
|
|
|
| |
Add _Scheduler_FIXME_thread_priority_queues_are_broken to prevent thread
priority queues in case an EDF scheduler is used.
|
|
|
|
|
|
|
| |
Delete _Watchdog_Report_chain(). These two functions use printk() with
thread dispatching and interrupts disabled. So they are pretty useless
in real applications. They are not part of the application APIs. They
are only used in one test and do nothing useful in this test.
|
|
|
|
| |
Partially revert commit 2a713e3b944625c45154f0ea7f5703e918de758.
|
|
|
|
|
| |
Add and use _Heap_Protection_set_delayed_free_fraction(). This makes it
possible to avoid a dependency on _Thread_Dispatch_is_enabled().
|
|
|
|
| |
We are not interested in the sequential boot time.
|
| |
|
|
|
|
| |
Do not check ISR level in _Debug_Is_thread_dispatching_allowed().
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Add _Debug_Is_owner_of_giant(). This makes it possible to assert the
opposite.
|
|
|
|
|
|
|
|
| |
Add _Debug_Is_thread_dispatching_allowed(). This makes it possible to
assert the opposite.
Use _ISR_Disable_without_giant()/_ISR_Enable_without_giant() to avoid
misleading secondary assertion failures.
|
|
|
|
|
|
| |
Enable pthread_once() for all configurations. The pthread_once()
function is one means to initialize POSIX keys. Another use case is the
C++ support.
|
|
|
|
| |
Make _ISR_Enable_without_giant() available for non-SMP configurations.
|
|
|
|
|
| |
It is sufficient to use one field for the chain on/off indication. The
chain API functions are highly performance critical.
|
| |
|
| |
|