summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadqenqueue.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-03-22Mark parameters as intentionally unusedSebastian Huber1-0/+1
The parameters are unused due to API constraints. The functions are used through function pointers. Alternative implementations may use the parameters. Update #4862.
2023-05-20Update company nameSebastian Huber1-1/+1
The embedded brains GmbH & Co. KG is the legal successor of embedded brains GmbH.
2022-02-28score/src/[t-z]*.c: Change license to BSD-2Joel Sherrill1-3/+22
Updates #3053.
2021-11-23score: _Thread_queue_Surrender_no_priority()Sebastian Huber1-15/+1
Simplify _Thread_queue_Surrender_no_priority() and use _Thread_queue_Resume(). Update #4546.
2021-11-23score: Move _Thread_queue_Extract()Sebastian Huber1-34/+3
Move _Thread_queue_Extract() since this function is not used by the core services (threads, semaphores, mutexes, message queues). Update #4546.
2021-11-23score: Simplify thread wait state handlingSebastian Huber1-6/+3
Remove the THREAD_WAIT_STATE_READY_AGAIN and simply use the initial value to indicate that a thread does not wait on something. Rename THREAD_WAIT_FLAGS_INITIAL to THREAD_WAIT_STATE_READY. This change is necessary so that _Thread_Continue() can be called for threads which never waited on something (for example dormant threads). Update #4546.
2021-11-23score: Add SMP scheduler make/clean stickySebastian Huber1-3/+3
This patch fixes the following broken behaviour: While a thread is scheduled on a helping scheduler, while it does not own a MrsP semaphore, if it obtains a MrsP semaphore, then no scheduler node using an idle thread and the ceiling priority of the semaphore is unblocked for the home scheduler. This could lead to priority inversion issues and is not in line with the MrsP protocol. Introduce two new scheduler operations which are only enabled if RTEMS_SMP is defined. The operations are used to make the scheduler node of the home scheduler sticky and to clean the sticky property. This helps to keep the sticky handing out of the frequently used priority update operation. Close #4532.
2021-10-11score: _Thread_queue_Surrender_priority_ceiling()Sebastian Huber1-2/+2
Do not use a direct thread dispatch in _Thread_queue_Surrender_priority_ceiling() since it may be used in condition variables using POSIX mutexes. Close #4526.
2021-10-01score: Add Thread_queue_Deadlock_statusSebastian Huber1-33/+43
Replace the boolen return value with the new enum Thread_queue_Deadlock_status. This improves the code readability. Improve documentation. Shorten function names.
2021-10-01score: Avoid dead code in thread queue surrenderSebastian Huber1-12/+67
For uniprocessor configurations, this patch removes dead code in the _Thread_queue_Surrender() and _Thread_queue_Surrender_priority_ceiling() functions. Dead code is removed from _Thread_queue_Surrender_sticky().
2021-09-01score: Remove _Thread_queue_Unblock_critical()Sebastian Huber1-32/+6
This function was only used in one place. Replace it with a call to _Thread_queue_Resume().
2021-09-01score: Fix blocking message queue receiveSebastian Huber1-20/+25
In order to ensure FIFO fairness across schedulers, the thread queue surrender operation must be used to dequeue a thread from the thread queue. The thread queue extract operation is intended for timeouts. Add _Thread_queue_Resume() which may be used to make extracted or surrendered threads ready again. Remove the now unused _Thread_queue_Extract_critical() function. Close #4509.
2021-09-01score: Fix priority discipline handlingSebastian Huber1-0/+109
The priority queues in clustered scheduling configurations use a per scheduler priority queue rotation to ensure FIFO fairness across schedulers. This mechanism is implemented in the thread queue surrender operation. Unfortunately some semaphore and message queue directives used wrongly the thread queue extract operation. Fix this through the use of _Thread_queue_Surrender(). Update #4358.
2021-06-15score: Comment _Thread_queue_Surrender_sticky()Sebastian Huber1-1/+7
The change also helps to avoid reports from static analysers since most callers of _Thread_queue_Make_ready_again() check the unblock status.
2021-04-20score: Remove unused _Thread_queue_Dequeue()Sebastian Huber1-32/+0
Last use was removed by: commit 54550e048d3a49435912797d2024f80671e93267 Author: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Fri May 13 08:16:30 2016 +0200 posix: Rework pthread_join() Rework pthread_join() to use _Thread_Join().
2020-12-02score: Canonicalize Doxygen @file commentsSebastian Huber1-2/+9
Use common phrases for the file brief descriptions. Update #3706.
2020-08-21score: Fix set but not used warningSebastian Huber1-1/+1
2020-04-28doxygen: Switch @brief and @ingroupSebastian Huber1-1/+2
This order change fixes the Latex documentation build via Doxygen.
2020-04-16Canonicalize config.h includeSebastian Huber1-1/+1
Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
2019-04-04doxygen: Rename Score* groups in RTEMSScore*Sebastian Huber1-1/+1
Update #3706
2017-11-16score: Fix priority ceiling updatesSebastian Huber1-1/+1
We must not clear the priority updates in _Thread_queue_Extract_locked() since this function is used by the priority ceiling surrender operations after the ceiling priority handover from the previous owner to the new owner. This is especially important in SMP configurations. Move the _Thread_queue_Context_clear_priority_updates() invocation to the callers. Close #3237.
2017-10-24score: Move thread queue timeout handlingSebastian Huber1-38/+16
Update #3117. Update #3182.
2017-10-24score: Rename function threadq support functionSebastian Huber1-1/+1
Rename _Thread_queue_Context_set_do_nothing_enqueue_callout() into _Thread_queue_Context_set_enqueue_do_nothing_extra(). More _Thread_queue_Context_set_enqueue_*() functions will follow. Update #3117. Update #3182.
2017-10-24score: Add _Thread_Add_timeout_ticks()Sebastian Huber1-2/+1
Replace _Thread_Timer_insert_monotonic() with _Thread_Add_timeout_ticks(). Update #3117. Update #3182.
2017-10-17score: Rename watchdog variantsSebastian Huber1-2/+2
Rename PER_CPU_WATCHDOG_RELATIVE in PER_CPU_WATCHDOG_MONOTONIC to highlight the corresponding POSIX CLOCK_MONOTONIC. Rename PER_CPU_WATCHDOG_ABSOLUTE in PER_CPU_WATCHDOG_REALTIME to highlight the corresponding POSIX CLOCK_REALTIME. Update #3117. Update #3182.
2017-10-10score: Add _Thread_queue_Dispatch_disable()Sebastian Huber1-12/+4
2016-12-12score: Introduce _Internal_error()Sebastian Huber1-3/+2
2016-12-09score: Remove fatal is internal indicatorSebastian Huber1-6/+1
The fatal is internal indicator is redundant since the fatal source and error code uniquely identify a fatal error. Keep the fatal user extension is internal parameter for backward compatibility and set it to false always. Update #2825.
2016-12-02score: Fix debug thread queue context initSebastian Huber1-2/+2
On ARM Thumb we may have function addresses ending with 0x7f, if we are lucky.
2016-11-28score: Fix thread queue context initializationSebastian Huber1-0/+5
Initialize the thread queue context with invalid data in debug configurations to catch missing set up steps.
2016-11-24score: Optimize _Thread_queue_Enqueue()Sebastian Huber1-3/+2
Move thread state for _Thread_queue_Enqueue() to the thread queue context. This reduces the parameter count of _Thread_queue_Enqueue() from five to four (ARM for example has only four function parameter registers). Since the thread state is used after several function calls inside _Thread_queue_Enqueue() this parameter was saved on the stack previously.
2016-11-23score: Rename _Thread_queue_Enqueue_critical()Sebastian Huber1-1/+1
Delete unused _Thread_queue_Enqueue() and rename _Thread_queue_Enqueue_critical() to _Thread_queue_Enqueue().
2016-11-23score: Add thread queue enqueue calloutSebastian Huber1-11/+11
Replace the expected thread dispatch disable level with a thread queue enqueue callout. This enables the use of _Thread_Dispatch_direct() in the thread queue enqueue procedure. This avoids impossible exection paths, e.g. Per_CPU_Control::dispatch_necessary is always true.
2016-11-03score: Introduce thread resource count methodsSebastian Huber1-1/+1
This makes it easier to conditionally enable/disable the thread resource count usage.
2016-11-02score: First part of new MrsP implementationSebastian Huber1-23/+128
Update #2556.
2016-09-21score: Scheduler node awareness for thread queuesSebastian Huber1-31/+66
Maintain the priority of a thread for each scheduler instance via the thread queue enqueue, extract, priority actions and surrender operations. This replaces the primitive priority boosting. Update #2556.
2016-09-21score: Rework thread priority managementSebastian Huber1-60/+62
Add priority nodes which contribute to the overall thread priority. The actual priority of a thread is now an aggregation of priority nodes. The thread priority aggregation for the home scheduler instance of a thread consists of at least one priority node, which is normally the real priority of the thread. The locking protocols (e.g. priority ceiling and priority inheritance), rate-monotonic period objects and the POSIX sporadic server add, change and remove priority nodes. A thread changes its priority now immediately, e.g. priority changes are not deferred until the thread releases its last resource. Replace the _Thread_Change_priority() function with * _Thread_Priority_perform_actions(), * _Thread_Priority_add(), * _Thread_Priority_remove(), * _Thread_Priority_change(), and * _Thread_Priority_update(). Update #2412. Update #2556.
2016-09-08score: Introduce Thread_queue_Lock_contextSebastian Huber1-25/+27
Introduce Thread_queue_Lock_context to contain the context necessary for thread queue lock and thread wait lock acquire/release operations to reduce the Thread_Control size.
2016-09-08score: Simplify thread queue acquire/releaseSebastian Huber1-2/+2
2016-08-11score: Introduce thread queue surrender operationSebastian Huber1-3/+1
This is an optimization for _Thread_queue_Surrender(). It helps to encapsulate the priority boosting in the priority inheritance thread queue operations.
2016-08-11score: Dismantle _Thread_queue_Do_extract_locked()Sebastian Huber1-28/+39
Dismantle _Thread_queue_Do_extract_locked() into re-usable parts like _Thread_queue_MP_set_callout() and _Thread_queue_Make_ready_again(). Use them in _Thread_queue_Surrender() to propare for a new thread queue surrender operation.
2016-08-11score: Add _Thread_queue_Surrender()Sebastian Huber1-0/+50
Add _Thread_queue_Surrender() to unify the mutex surrender procedures which involve a thread queue operation.
2016-08-08score: Add debug support to red-black treesSebastian Huber1-0/+1
This helps to detect double insert and extract errors.
2016-08-04score: Fix _Thread_queue_Path_release()Sebastian Huber1-8/+13
It is possible that the owner of the terminal link of a thread queue path waits on a thread queue. However, this thread queue has no owner, e.g. a thread queue of a message queue.
2016-08-04score: Optimize _Thread_queue_Path_release()Sebastian Huber1-7/+29
Update #2556.
2016-08-03score: Fix and simplify thread wait locksSebastian Huber1-20/+24
There was a subtile race condition in _Thread_queue_Do_extract_locked(). It must first update the thread wait flags and then restore the default thread wait state. In the previous implementation this could lead under rare timing conditions to an ineffective _Thread_Wait_tranquilize() resulting to a corrupt system state. Update #2556.
2016-07-27score: Add deadlock detectionSebastian Huber1-15/+250
The mutex objects use the owner field of the thread queues for the mutex owner. Use this and add a deadlock detection to _Thread_queue_Enqueue_critical() for thread queues with an owner. Update #2412. Update #2556. Close #2765.
2016-07-27score: Turn thread lock into thread wait lockSebastian Huber1-23/+68
The _Thread_Lock_acquire() function had a potentially infinite run-time due to the lack of fairness at atomic operations level. Update #2412. Update #2556. Update #2765.
2016-07-27score: Priority inherit thread queue operationsSebastian Huber1-3/+5
Move the priority change due to priority interitance to the thread queue enqueue operation to simplify the locking on SMP configurations. Update #2412. Update #2556. Update #2765.
2016-07-26score: FormatSebastian Huber1-9/+9