summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthread.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* score: Add _Watchdog_Preinitialize()Sebastian Huber2015-06-131-0/+1
| | | | | | Add an assert to ensure that the watchdog is the proper state for a _Watchdog_Initialize(). This helps to detect invalid initializations which may lead to a corrupt watchdog chain.
* score: Rework _Thread_Change_priority()Sebastian Huber2015-05-191-46/+50
| | | | | | | | | | | | | Move the writes to Thread_Control::current_priority and Thread_Control::real_priority into _Thread_Change_priority() under the protection of the thread lock. Add a filter function to _Thread_Change_priority() to enable specialized variants. Avoid race conditions during a thread priority restore with the new Thread_Control::priority_restore_hint for an important average case optimizations used by priority inheritance mutexes. Update #2273.
* score: Delete Thread_queue_Control::timeout_statusSebastian Huber2015-05-191-5/+1
| | | | | Use a parameter for _Thread_queue_Enqueue() instead to reduce memory usage.
* score: Add Thread_queue_Control::LockSebastian Huber2015-05-191-0/+2
| | | | | | | | | | | Move the complete thread queue enqueue procedure into _Thread_queue_Enqueue_critical(). It is possible to use the thread queue lock to protect state of the object embedding the thread queue. This enables per object fine grained locking in the future. Delete _Thread_queue_Enter_critical_section(). Update #2273.
* score: Add header to _Watchdog_Remove()Sebastian Huber2015-05-191-1/+1
| | | | | | | | Add watchdog header parameter to _Watchdog_Remove() to be in line with the other operations. Add _Watchdog_Remove_ticks() and _Watchdog_Remove_seconds() for convenience. Update #2307.
* score: Delete Thread_queue_Control::stateSebastian Huber2015-04-231-1/+0
| | | | | Use a parameter for _Thread_queue_Enqueue() instead to reduce memory usage.
* score: Add and use _Thread_Owns_resources()Sebastian Huber2014-06-031-2/+2
|
* score: Simplify thread control initializationSebastian Huber2014-04-151-22/+3
| | | | | | | | | | | The thread control block contains fields that point to application configuration dependent memory areas, like the scheduler information, the API control blocks, the user extension context table, the RTEMS notepads and the Newlib re-entrancy support. Account for these areas in the configuration and avoid extra workspace allocations for these areas. This helps also to avoid heap fragementation and reduces the per thread memory due to a reduced heap allocation overhead.
* pthread.c: Conditionalize thread affinity initializationJoel Sherrill2014-04-031-1/+1
|
* posix: Modified pthread init to use cpuset default.Jennifer Averett2014-04-031-12/+8
|
* score: Relax Giant lock usage for API mutexesSebastian Huber2014-03-311-1/+1
| | | | | It is no longer necessary to protect the workspace allocations with the Giant lock due to the thread life cycle re-implementation.
* score: Thread life cycle re-implementationSebastian Huber2014-03-311-7/+15
| | | | | | | | | | | | | | | | | | | 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.