summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/threadqimpl.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-04-20score: Remove unused _Thread_queue_Dequeue()Sebastian Huber1-51/+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-5/+7
Use common phrases for the file brief descriptions. Update #3706.
2019-05-13doxygen: score: adjust doc in threadqimpl.h to doxygen guidelinesAndreas Dachsberger1-77/+317
Update #3706.
2019-04-04doxygen: Rename Score* groups in RTEMSScore*Sebastian Huber1-1/+1
Update #3706
2019-02-28Remove explicit file names from @fileSebastian Huber1-1/+1
This makes the @file documentation independent of the actual file name. Update #3707.
2018-10-05score: Fix legacy RTEMS_STATIC_ASSERT()Sebastian Huber1-2/+2
In standard C pointer operands are not allowed in integer constant expressions. Avoid a static assertion based on an array typedef since this could lead to warnings ("variably modified 'x' at file scope" and "typedef 'x' locally defined but not used"); This implementation requires unique messages.
2018-01-25Remove make preinstallChris Johns1-0/+0
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
2017-10-24score: Move thread queue timeout handlingSebastian Huber1-25/+85
Update #3117. Update #3182.
2017-10-24score: Rename function threadq support functionSebastian Huber1-5/+5
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-10score: Add _Thread_queue_Dispatch_disable()Sebastian Huber1-0/+10
2017-07-31score: Add RTEMS_HAVE_MEMBER_SAME_TYPE()Sebastian Huber1-2/+6
This fixes some "variably modified" warnings and a clang compile error.
2017-01-31score: Add _Thread_queue_Object_nameSebastian Huber1-2/+46
Add the special thread queue name _Thread_queue_Object_name to mark thread queues embedded in an object with identifier. Using the special thread state STATES_THREAD_QUEUE_WITH_IDENTIFIER is not reliable for this purpose since the thread wait information and thread state are protected by different SMP locks in separate critical sections. Remove STATES_THREAD_QUEUE_WITH_IDENTIFIER. Add and use _Thread_queue_Object_initialize(). Update #2858.
2017-01-13score: Add Thread_queue_Queue::nameSebastian Huber1-12/+26
Update #2858.
2017-01-11score: Improve SMP lock debug supportSebastian Huber1-1/+1
The CPU index starts with zero. Increment it by one, to allow global SMP locks to reside in the BSS section.
2016-12-02score: Fix debug thread queue context initSebastian Huber1-0/+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-3/+4
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-8/+44
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-48/+10
Delete unused _Thread_queue_Enqueue() and rename _Thread_queue_Enqueue_critical() to _Thread_queue_Enqueue().
2016-11-23score: Add thread queue enqueue calloutSebastian Huber1-10/+35
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-18score: Optimize self-contained objectsSebastian Huber1-0/+19
Avoid use of the stack for the hot paths.
2016-11-04score: Use non-inline thread queue lock opsSebastian Huber1-19/+35
This reduces the code size and helps to reduce the amount of testing. Hot paths can use the _Thread_queue_Queue_acquire_critical() and _Thread_queue_Queue_release_critical() functions which are still inline.
2016-11-02score: First part of new MrsP implementationSebastian Huber1-0/+62
Update #2556.
2016-09-21score: Scheduler node awareness for thread queuesSebastian Huber1-3/+3
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-80/+65
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-6/+6
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-10/+32
2016-08-11score: Introduce thread queue surrender operationSebastian Huber1-25/+0
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: Add _Thread_queue_Surrender()Sebastian Huber1-0/+27
Add _Thread_queue_Surrender() to unify the mutex surrender procedures which involve a thread queue operation.
2016-08-03score: Fix and simplify thread wait locksSebastian Huber1-106/+6
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-0/+38
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-3/+145
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-0/+23
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-26cpukit: refactor nanosleep and use 64-bit timeout for threadqGedare Bloom1-1/+1
* Fixes a bug with elapsed time calculations misusing absolute time arguments in nanosleep_helper by passing the requested relative interval. * Fixes a bug with truncation of absolute timeouts by passing the full 64-bit value to Thread_queue_Enqueue. * Share yield logic between nanosleep and clock_nanosleep. updates #2732
2016-07-25cpukit: Add and use Watchdog_Discipline.Gedare Bloom1-7/+60
Clock disciplines may be WATCHDOG_RELATIVE, WATCHDOG_ABSOLUTE, or WATCHDOG_NO_TIMEOUT. A discipline of WATCHDOG_RELATIVE with a timeout of WATCHDOG_NO_TIMEOUT is equivalent to a discipline of WATCHDOG_NO_TIMEOUT. updates #2732
2016-07-22score: Add debug support to chainsSebastian Huber1-0/+2
This helps to detect * double insert, append, prepend errors, and * get from empty chain errors.
2016-05-30score: _CORE_mutex_Check_dispatch_for_seize()Sebastian Huber1-12/+38
Move the safety check performed by _CORE_mutex_Check_dispatch_for_seize() out of the performance critical path and generalize it. Blocking on a thread queue with an unexpected thread dispatch disabled level is illegal in all system states. Add the expected thread dispatch disable level (which may be 1 or 2 depending on the operation) to Thread_queue_Context and use it in _Thread_queue_Enqueue_critical().
2016-05-30score: Add _Thread_queue_Context_set_MP_callout()Sebastian Huber1-25/+22
Add _Thread_queue_Context_set_MP_callout() to simplify _Thread_queue_Context_initialize(). This makes it possible to more easily add additional fields to Thread_queue_Context.
2016-05-30score: Adjust thread queue layoutSebastian Huber1-3/+4
Adjust thread queue layout according to Newlib. This makes it possible to use the same implementation for <sys/lock.h> and CORE mutexes in the future.
2016-05-26score: Add Status_Control for all APIsSebastian Huber1-5/+35
Unify the status codes of the Classic and POSIX API to use the new enum Status_Control. This eliminates the Thread_Control::Wait::timeout_code field and the timeout parameter of _Thread_queue_Enqueue_critical() and _MPCI_Send_request_packet(). It gets rid of the status code translation tables and instead uses simple bit operations to get the status for a particular API. This enables translation of status code constants at compile time. Add _Thread_Wait_get_status() to avoid direct access of thread internal data structures.
2016-05-25score: Move thread queue MP callout to contextSebastian Huber1-109/+82
Drop the multiprocessing (MP) dependent callout parameter from the thread queue extract, dequeue, flush and unblock methods. Merge this parameter with the lock context into new structure Thread_queue_Context. This helps to gets rid of the conditionally compiled method call helpers.
2016-05-25score: Get rid of mp_id parameterSebastian Huber1-30/+8
Get rid of the mp_id parameter used for some thread queue methods. Use THREAD_QUEUE_QUEUE_TO_OBJECT() instead.
2016-05-25score: Move thread queue object supportSebastian Huber1-0/+27
2016-05-25mpci: Fix thread queue flush methodSebastian Huber1-49/+11
We must call the MP callout for proxies if we unblock them after a thread queue extraction. This was missing in _Thread_queue_Flush_critical(). Move thread remove timer and unblock code to new function _Thread_Remove_timer_and_unblock().
2016-05-20score: Use _RBTree_Insert_inline()Sebastian Huber1-15/+0
Use _RBTree_Insert_inline() for priority thread queues. Update #2556.
2016-05-12score: Avoid Giant lock for scheduler set/getSebastian Huber1-3/+23
Update #2555.
2016-05-12score: Add _Thread_queue_Is_lock_owner()Sebastian Huber1-3/+45
Add _Thread_queue_Is_lock_owner() in case RTEMS_DEBUG is defined.
2016-04-22score: Add _Thread_queue_Flush_default_filter()Sebastian Huber1-0/+15
2016-04-22score: Add _Thread_queue_Is_empty()Sebastian Huber1-0/+7
2016-04-21score: Introduce _Thread_queue_Flush_critical()Sebastian Huber1-24/+63
Replace _Thread_queue_Flush() with _Thread_queue_Flush_critical() and add a filter function for customization of the thread queue flush operation. Update #2555.
2016-04-06score: Rework MP thread queue callout supportSebastian Huber1-31/+182
The thread queue implementation was heavily reworked to support SMP. This broke the multiprocessing support of the thread queues. This is fixed by this patch. A thread proxy is unblocked due to three reasons 1) timeout, 2) request satisfaction, and 3) extraction. In case 1) no MPCI message must be sent. This is ensured via the _Thread_queue_MP_callout_do_nothing() callout set during _Thread_MP_Allocate_proxy(). In case 2) and 3) an MPCI message must be sent. In case we interrupt the blocking operation during _Thread_queue_Enqueue_critical(), then this message must be sent by the blocking thread. For this the new fields Thread_Proxy_control::thread_queue_callout and Thread_Proxy_control::thread_queue_id are used. Delete the individual API MP callout types and use Thread_queue_MP_callout throughout. This type is only defined in multiprocessing configurations. Prefix the multiprocessing parameters with mp_ to ease code review. Multiprocessing specific parameters are optional due to use of a similar macro pattern. There is no overhead for non-multiprocessing configurations.