summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthread.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* cpukit/posix/src/[p-z]*.c: Change license to BSD-2Joel Sherrill2022-02-281-3/+22
| | | | Updates #3053.
* doxygen: Switch @brief and @ingroupSebastian Huber2020-04-281-1/+2
| | | | This order change fixes the Latex documentation build via Doxygen.
* Canonicalize config.h includeSebastian Huber2020-04-161-1/+1
| | | | | | | | Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
* config: Add <rtems/confdefs/threads.h>Sebastian Huber2020-02-251-0/+2
| | | | | | | | Remove all comments and copyrightable content from the moved content. Use BSD-2-Clause license for new file. Update #3053. Update #3875.
* score: Static Objects_Information initializationSebastian Huber2018-12-141-186/+5
| | | | | | | | | | | Statically allocate the objects information together with the initial set of objects either via <rtems/confdefs.h>. Provide default object informations with zero objects via librtemscpu.a. This greatly simplifies the workspace size estimate. RTEMS applications which do not use the unlimited objects option are easier to debug since all objects reside now in statically allocated objects of the right types. Close #3621.
* posix: Provide threads by defaultSebastian Huber2018-10-291-2/+8
| | | | Update #2514.
* posix: Split posix_api_configuration_tableSebastian Huber2018-10-291-2/+1
| | | | | | Use separate configuration variables to avoid false dependencies. Update #2514.
* score: Remove bogus thread object name supportSebastian Huber2018-10-291-3/+1
| | | | Update #2514.
* score: Introduce new monotonic clockSebastian Huber2018-02-021-2/+2
| | | | | | | | Rename PER_CPU_WATCHDOG_MONOTONIC to PER_CPU_WATCHDOG_TICKS. Add new PER_CPU_WATCHDOG_MONOTONIC which is based on the system uptime (measured by timecounter). Close #3264.
* posix: Remove POSIX_API_Control::schedpolicySebastian Huber2017-11-091-5/+1
| | | | | | | Use the thread CPU budget algorithm to determine the scheduler policy. This fixes also pthread_getschedparam() for Classic tasks. Update #2514.
* posix: Simplify _POSIX_Threads_Create_extension()Sebastian Huber2017-10-171-17/+0
| | | | | | Move unblocked signals initialization to pthread_create(). Update #2514.
* posix: Remove POSIX_API_Control::schedparamSebastian Huber2017-10-171-6/+0
| | | | | | | | Move sporadic server scheduler parameters to POSIX_API_Control::Sporadic. Remove redundant scheduler priority parameter. Update #2514.
* posix: Move POSIX_API_Control::threadSebastian Huber2017-10-171-2/+2
| | | | | | This member is only used by the sporadic server support. Update #2514.
* posix: Fix _POSIX_Threads_Create_extension()Sebastian Huber2017-10-171-0/+1
| | | | | | The thread POSIX API control must be fully initialized in _POSIX_Threads_Create_extension(), otherwise a pthread_setschedparam() is broken for all threads not created with pthread_create().
* score: Rename watchdog variantsSebastian Huber2017-10-171-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.
* score: Remove CPU_set_ControlSebastian Huber2017-10-111-1/+0
| | | | | | Use Processor_mask instead. Update #2514.
* posix: Unconditional thread attribute supportSebastian Huber2017-10-101-39/+0
| | | | Update #2514.
* posix: Constify default thread processor affinitySebastian Huber2017-10-101-17/+2
| | | | | | | | Set default thread processor affinity to all processors of the pre-allocated set. This allows to constify the _POSIX_Threads_Default_attributes. Update #2514.
* posix: Simplify POSIX_API_ControlSebastian Huber2017-10-091-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | Return stack area via pthread_getattr_np(). Simplify * pthread_attr_setaffinity_np(), and * pthread_attr_getaffinity_np() and let the scheduler do the more sophisticated error checks. Make * pthread_setaffinity_np(), * pthread_getaffinity_np(), * pthread_attr_setaffinity_np(), and * pthread_attr_getaffinity_np() available in all configurations. Update #2514. Close #3145. Close #3168.
* Fix CPU_COPY() usageSebastian Huber2017-06-071-1/+1
| | | | | | | | The original CPU_COPY() support of Newlib <sys/cpuset.h> had the parameters in the wrong order. This is fixed in Newlib since 2017-05-22. Update #3023.
* Remove obsolete __RTEMS_HAVE_SYS_CPUSET_H__Joel Sherrill2017-01-111-6/+4
|
* score: Initialize thread queue context earlySebastian Huber2016-12-021-2/+4
| | | | | | | | Initialize thread queue context early preferably outside the critical section. Remove implicit _Thread_queue_Context_initialize() from _Thread_Wait_acquire().
* score: Fix thread queue context initializationSebastian Huber2016-11-281-2/+2
| | | | | Initialize the thread queue context with invalid data in debug configurations to catch missing set up steps.
* score: Introduce Thread_Scheduler_control::homeSebastian Huber2016-11-021-1/+1
| | | | | | | | Replace Thread_Scheduler_control::control and Thread_Scheduler_control::own_control with new Thread_Scheduler_control::home. Update #2556.
* score: Rework thread priority managementSebastian Huber2016-09-211-59/+44
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* score: Introduce _Thread_Get_priority()Sebastian Huber2016-09-081-3/+3
| | | | Avoid direct access to thread internal data fields.
* posix: Make POSIX API aware of scheduler instancesSebastian Huber2016-06-221-1/+3
|
* posix: Rework sporadic server scheduling policySebastian Huber2016-06-221-62/+43
| | | | | | | | | | | | | | Instead of lowering the priority in case the initial budget is consumed raise the priority for each new period. Restore the normal priority once the initial budget is consumed. This makes it later easier to combine the high priority phase with temporary priority boosts (e.g. via priority ceiling and inheritance). Use the thread lock to protect the POSIX thread attributes instead of the thread state lock. This makes it easier to change the thread priority and keep the POSIX attributes consistent. Fixes a false positive use of uninitialized variable warning.
* posix: Delete POSIX_API_Control::schedparamSebastian Huber2016-06-221-5/+9
| | | | This field was redundant.
* posix: Delete POSIX_API_Control::schedpolicySebastian Huber2016-06-221-2/+1
| | | | This field was redundant.
* posix: Fix poradic server initial CPU budgetSebastian Huber2016-06-151-4/+1
| | | | Update #2738.
* posix: Use _POSIX_Threads_Sporadic_timer_insert()Sebastian Huber2016-06-151-7/+1
|
* posix: Rework thread cancellationSebastian Huber2016-05-201-7/+0
| | | | | | | | Add Thread_Life_state::THREAD_LIFE_CHANGE_DEFERRED and rework the POSIX thread cancellation to use the thread life states. Update #2555. Update #2626.
* posix: Rework pthread_join()Sebastian Huber2016-05-201-45/+6
| | | | | | | | | Rework pthread_join() to use _Thread_Join(). Close #2402. Update #2555. Update #2626. Close #2714.
* posix: Avoid Giant lock for some pthread functionsSebastian Huber2016-05-121-7/+4
| | | | | | | | Avoid Giant lock for pthread_getattr_np(), pthread_setschedparam() and pthread_getschedparam(). Replace POSIX threads scheduler lock with thread state lock. Update #2555.
* score: Simplify _Objects_Initialize_information()Sebastian Huber2016-04-211-4/+0
| | | | | | Remove unused supports_global parameter. Convert _Objects_Initialize_information() to a macro to avoid use of RTEMS_MULTIPROCESSING define for each caller.
* posix: Use a dedicated lock for scheduler changesSebastian Huber2016-04-121-24/+41
| | | | Update #2555.
* score: Remove Thread_queue_Queue::operations fieldSebastian Huber2016-03-291-3/+4
| | | | | | | | | Remove the Thread_queue_Queue::operations field to reduce the size of this structure. Add a thread queue operations parameter to the _Thread_queue_First(), _Thread_queue_First_locked(), _Thread_queue_Enqueue(), _Thread_queue_Dequeue() and _Thread_queue_Flush() functions. This is a preparation patch to reduce the size of several synchronization objects.
* score: Replace watchdog handler implementationSebastian Huber2016-03-041-13/+18
| | | | | | | | | Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606.
* Delete unused API extensionsSebastian Huber2016-02-031-1/+0
|
* Use linker set for POSIX User Threads initSebastian Huber2016-02-031-24/+0
| | | | Update #2408.
* Optional POSIX Cleanup initializationSebastian Huber2016-02-031-15/+1
| | | | Update #2408.
* Optional POSIX Threads initializationSebastian Huber2016-02-031-1/+10
| | | | Update #2408.
* posix: Store unblocked signalsSebastian Huber2015-12-151-3/+1
| | | | | Store the unblock signals to exploit the zero-initialization of the thread control block.
* score: Initialize thread control to zeroSebastian Huber2015-12-151-7/+3
| | | | This reduces the code size of the thread initialization.
* score: Untangle thread actionsSebastian Huber2015-12-111-5/+1
| | | | | | | Remove the thread action handler parameter from _Thread_Action_initialize() and instead set it later in _Thread_Add_post_switch_action(). This avoids a dependency on the thread action handler via the thread initialization.
* posix: Require struct _pthread_cleanup_contextSebastian Huber2015-11-241-4/+0
| | | | | This structure is available in Newlib since 2013-11-29 (Git commit a534dfd26e765047621acd0eda656ded886e7108).
* basdefs.h: Add and use RTEMS_UNUSEDSebastian Huber2015-10-261-2/+2
|
* score: Rename _POSIX_Absolute_timeout_to_ticks()Sebastian Huber2015-07-281-1/+0
| | | | | | Rename _POSIX_Absolute_timeout_to_ticks() to _TOD_Absolute_timeout_to_ticks() and move it to the score directory. Delete empty <rtems/posix/time.h>.
* score: Introduce Thread_queue_HeadsSebastian Huber2015-07-231-4/+2
| | | | | | | | | | | | | Move the storage for the thread queue heads to the threads. Each thread provides a set of thread queue heads allocated from a dedicated memory pool. In case a thread blocks on a queue, then it lends its heads to the queue. In case the thread unblocks, then it takes a free set of threads from the queue. Since a thread can block on at most one queue this works. This mechanism is used in FreeBSD. The motivation for this change is to reduce the memory demands of the synchronization objects. On a 32-bit uni-processor configuration the Thread_queue_Control size is now 8 bytes, compared to 64 bytes in RTEMS 4.10 (other changes reduced the size as well).