summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coremutexsurrender.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-08-11score: Add _Thread_queue_Surrender()Sebastian Huber1-75/+0
Add _Thread_queue_Surrender() to unify the mutex surrender procedures which involve a thread queue operation.
2016-07-27score: Simplify _Thread_queue_Boost_priority()Sebastian Huber1-7/+7
Raise the priority under thread queue lock protection and omit the superfluous thread queue priority change, since the thread is extracted anyway. The unblock operation will pick up the new priority. Update #2412. Update #2556. Update #2765.
2016-05-30score: Rework CORE inherit priority mutexSebastian Huber1-105/+22
Provide dedicated seize and surrender methods for inherit priority mutexes. This eliminates CORE_mutex_Attributes.
2016-05-30score: Rework CORE priority ceiling mutexSebastian Huber1-13/+3
Rework seize and surrender methods to use CORE_ceiling_mutex_Control. This eliminates CORE_mutex_Disciplines.
2016-05-30score: Add CORE mutex variantsSebastian Huber1-20/+8
Add CORE_recursive_mutex_Control and CORE_ceiling_mutex_Control to avoid the run-time evaluation of attributes to figure out how a particular mutex methods should behave. Start with the no protocol variants. This eliminates the CORE_MUTEX_DISCIPLINES_FIFO and CORE_MUTEX_DISCIPLINES_PRIORITY disciplines.
2016-05-30score: Simplify CORE mutexSebastian Huber1-3/+0
Remove superfluous support for simple binary semaphores. With this we can get rid of the CORE_MUTEX_NESTING_BLOCKS variant.
2016-05-26score: Add Status_Control for all APIsSebastian Huber1-7/+7
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-15/+12
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-3/+1
Get rid of the mp_id parameter used for some thread queue methods. Use THREAD_QUEUE_QUEUE_TO_OBJECT() instead.
2016-05-25mpci: Fix thread queue flush methodSebastian Huber1-2/+0
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-02score: Delete __RTEMS_STRICT_ORDER_MUTEX__Sebastian Huber1-55/+0
Remove support for strict order mutexes. Close #2124.
2016-04-06score: Rework MP thread queue callout supportSebastian Huber1-36/+10
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.
2016-03-29score: Fix CORE mutex RTEMS_MULTIPROCESSINGSebastian Huber1-8/+3
Make sure that the thread proxy is registered as the mutex owner.
2016-03-29score: Remove Thread_queue_Queue::operations fieldSebastian Huber1-2/+8
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.
2015-10-26basdefs.h: Add and use RTEMS_UNUSEDSebastian Huber1-2/+2
2015-09-04score: Implement priority boostingSebastian Huber1-0/+1
2015-07-23score: Move wait flag update to tq extractSebastian Huber1-1/+4
This makes it possible to use _Thread_queue_Extract_locked() for barrier operations which extract all threads on the queue in one critical section.
2015-07-23score: Introduce Thread_queue_QueueSebastian Huber1-2/+6
Separate the thread queue heads and lock from the operations. This enables the support for light weight objects which only support one queuing discipline.
2015-05-19score: Rework _Thread_Change_priority()Sebastian Huber1-14/+17
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.
2015-05-19score: Fine grained locking for mutexesSebastian Huber1-24/+62
Update #2273.
2015-03-11cpukit: Remove old DESCRIPTION: in commentsJoel Sherrill1-2/+0
These were remnants of pre-Doxygen comment style.
2014-06-03score: Add and use _Thread_Owns_resources()Sebastian Huber1-1/+1
2014-03-31score: Delete CORE_mutex_Control::lockSebastian Huber1-2/+1
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.
2014-03-31score: Delete CORE_mutex_Control::holder_idSebastian Huber1-4/+1
We can use the holder pointer to get the identifier if necessary.
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2013-07-26score: Create threadq implementation headerSebastian Huber1-1/+0
Move implementation specific parts of tqdata.h, threadq.h and threadq.inl into new header file threadqimpl.h. The threadq.h contains now only the application visible API. Delete tqdata.h.
2013-07-26score: Create states implementation headerSebastian Huber1-1/+0
Move implementation specific parts of states.h and states.inl into new header file statesimpl.h. The states.h contains now only the application visible API.
2013-07-18score: Create mutex implementation headerSebastian Huber1-1/+1
Move implementation specific parts of coremutex.h and coremutex.inl into new header file coremuteximpl.h. The coremutex.h contains now only the application visible API.
2013-05-18score: use reference with strict mutexGedare Bloom1-1/+1
2012-11-29Score misc: Clean up Doxygen #8 (GCI 2012)Mathew Kallada1-7/+7
This patch is a task from GCI 2012 which improves the Doxygen comments in the RTEMS source. http://www.google-melange.com/gci/task/view/google/gci2012/7970221
2012-05-11Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill1-2/+0
Script does what is expected and tries to do it as smartly as possible. + remove occurrences of two blank comment lines next to each other after Id string line removed. + remove entire comment blocks which only exited to contain CVS Ids + If the processing left a blank line at the top of a file, it was removed.
2011-02-142011-02-14 Joel Sherrill <joel.sherrilL@OARcorp.com>Joel Sherrill1-1/+1
* rtems/src/semtranslatereturncode.c, score/src/coremutexsurrender.c: Now all conditionals have the correct sense and all tests pass.
2011-02-112011-02-11 Joel Sherrill <joel.sherrilL@OARcorp.com>Joel Sherrill1-3/+5
* rtems/src/semtranslatereturncode.c, score/include/rtems/score/coremutex.h, score/src/coremutexsurrender.c, score/src/objectinitializeinformation.c: Disable code not reachable when POSIX is not enabled.
2010-07-152010-07-15 Sebastian Huber <Sebastian.Huber@embedded-brains.de>Joel Sherrill1-36/+63
PR 1607/cpukit * score/src/coremutexsurrender.c: Clean up and split out helper routines.
2009-11-29Whitespace removal.Ralf Corsepius1-1/+1
2009-07-072009-07-07 Joel Sherrill <joel.sherrill@OARcorp.com>Joel Sherrill1-11/+21
* posix/src/mutexsetprioceiling.c: Restructure to eliminate code paths which are unreachable. Also add more comments. * score/src/coremutexsurrender.c: Mark some code as RTEMS_DEBUG only since it cannot be hit unless coremutexseize.c is broken.
2008-12-31Add __attribute__((unused)) to unused function args.Ralf Corsepius1-0/+5
2008-12-22Eliminate TRUE/FALSE.Ralf Corsepius1-3/+3
2008-06-30Rename __STRICT_ORDER_MUTEX__ to __RTEMS_STRICT_ORDER_MUTEX__.Ralf Corsepius1-5/+5
2007-12-212007-12-21 Xi Yang <hiyangxi@gmail.com>Joel Sherrill1-2/+26
* configure.ac, score/include/rtems/score/coremutex.h, score/include/rtems/score/thread.h, score/inline/rtems/score/coremutex.inl, score/src/coremutexsurrender.c, score/src/threadinitialize.c: Add support for proper stacking of priority inheritance on mutexes as well as enforce proper order of release.
2007-03-052007-03-05 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-2/+9
PR 1222/cpukit * score/Makefile.am, score/include/rtems/score/coremutex.h, score/include/rtems/score/threadq.h, score/inline/rtems/score/coremutex.inl, score/src/coremsgsubmit.c, score/src/coremutexsurrender.c, score/src/threadchangepriority.c, score/src/threadclearstate.c, score/src/threadhandler.c, score/src/threadinitialize.c, score/src/threadqdequeuefifo.c, score/src/threadqdequeuepriority.c, score/src/threadqenqueue.c, score/src/threadqenqueuefifo.c, score/src/threadqenqueuepriority.c, score/src/threadqextractfifo.c, score/src/threadqextractpriority.c, score/src/threadsetstate.c: Enhance so that when the prioirity of a thread that is blocked on a priority based thread queue is changed, that its placement in the queue is reevaluated based upon the new priority. This enhancement includes modifications to the SuperCore as well as new test cases. * score/src/threadqrequeue.c: New file.
2006-07-112006-07-11 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-8/+19
PR 1124/rtems * score/include/rtems/score/threadq.h, score/src/coremutexseize.c, score/src/coremutexsurrender.c, score/src/threadqenqueue.c, score/src/threadqenqueuefifo.c, score/src/threadqenqueuepriority.c: The placement of the changing a thread's priority when using priority ceiling should be on the successful transfer of the mutex -- not when the thread tries to acquire. Plus the lack of a dispatch disable point lead to the potential for a thread timing out and already having inherited the ceiling priority.
2005-01-27Include config.h.Ralf Corsepius1-0/+4
2004-04-18Remove stray white spaces.Ralf Corsepius1-4/+4
2004-04-17Remove stray white spaces.Ralf Corsepius1-1/+1
2004-04-15Remove stray white spaces.Ralf Corsepius1-1/+0
2003-09-042003-09-04 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-1/+1
* include/rtems/debug.h, include/rtems/seterr.h, include/rtems/system.h, include/rtems/score/address.h, include/rtems/score/apiext.h, include/rtems/score/apimutex.h, include/rtems/score/bitfield.h, include/rtems/score/chain.h, include/rtems/score/context.h, include/rtems/score/copyrt.h, include/rtems/score/coremsg.h, include/rtems/score/coremutex.h, include/rtems/score/coresem.h, include/rtems/score/heap.h, include/rtems/score/interr.h, include/rtems/score/isr.h, include/rtems/score/mpci.h, include/rtems/score/mppkt.h, include/rtems/score/object.h, include/rtems/score/objectmp.h, include/rtems/score/priority.h, include/rtems/score/stack.h, include/rtems/score/states.h, include/rtems/score/sysstate.h, include/rtems/score/thread.h, include/rtems/score/threadmp.h, include/rtems/score/threadq.h, include/rtems/score/tod.h, include/rtems/score/tqdata.h, include/rtems/score/userext.h, include/rtems/score/watchdog.h, include/rtems/score/wkspace.h, inline/rtems/score/address.inl, inline/rtems/score/chain.inl, inline/rtems/score/coremsg.inl, inline/rtems/score/coremutex.inl, inline/rtems/score/coresem.inl, inline/rtems/score/heap.inl, inline/rtems/score/isr.inl, inline/rtems/score/mppkt.inl, inline/rtems/score/object.inl, inline/rtems/score/objectmp.inl, inline/rtems/score/priority.inl, inline/rtems/score/stack.inl, inline/rtems/score/states.inl, inline/rtems/score/sysstate.inl, inline/rtems/score/thread.inl, inline/rtems/score/threadmp.inl, inline/rtems/score/tod.inl, inline/rtems/score/tqdata.inl, inline/rtems/score/userext.inl, inline/rtems/score/watchdog.inl, inline/rtems/score/wkspace.inl, macros/rtems/score/address.inl, macros/rtems/score/chain.inl, macros/rtems/score/coremsg.inl, macros/rtems/score/coremutex.inl, macros/rtems/score/coresem.inl, macros/rtems/score/heap.inl, macros/rtems/score/isr.inl, macros/rtems/score/mppkt.inl, macros/rtems/score/object.inl, macros/rtems/score/objectmp.inl, macros/rtems/score/priority.inl, macros/rtems/score/stack.inl, macros/rtems/score/states.inl, macros/rtems/score/sysstate.inl, macros/rtems/score/thread.inl, macros/rtems/score/threadmp.inl, macros/rtems/score/tod.inl, macros/rtems/score/tqdata.inl, macros/rtems/score/userext.inl, macros/rtems/score/watchdog.inl, macros/rtems/score/wkspace.inl, src/apiext.c, src/chain.c, src/coremsg.c, src/coremsgbroadcast.c, src/coremsgclose.c, src/coremsgflush.c, src/coremsgflushsupp.c, src/coremsgflushwait.c, src/coremsginsert.c, src/coremsgseize.c, src/coremsgsubmit.c, src/coremutex.c, src/coremutexflush.c, src/coremutexseize.c, src/coremutexsurrender.c, src/coresem.c, src/coresemflush.c, src/coresemseize.c, src/coresemsurrender.c, src/coretod.c, src/coretodset.c, src/coretodtickle.c, src/coretodtoseconds.c, src/coretodvalidate.c, src/heap.c, src/heapallocate.c, src/heapextend.c, src/heapfree.c, src/heapgetinfo.c, src/heapsizeofuserarea.c, src/heapwalk.c, src/interr.c, src/isr.c, src/iterateoverthreads.c, src/mpci.c, src/object.c, src/objectallocate.c, src/objectallocatebyindex.c, src/objectclearname.c, src/objectcomparenameraw.c, src/objectcomparenamestring.c, src/objectcopynameraw.c, src/objectcopynamestring.c, src/objectextendinformation.c, src/objectfree.c, src/objectget.c, src/objectgetbyindex.c, src/objectgetisr.c, src/objectgetnext.c, src/objectgetnoprotection.c, src/objectidtoname.c, src/objectinitializeinformation.c, src/objectmp.c, src/objectnametoid.c, src/objectshrinkinformation.c, src/thread.c, src/threadchangepriority.c, src/threadclearstate.c, src/threadclose.c, src/threadcreateidle.c, src/threaddelayended.c, src/threaddispatch.c, src/threadevaluatemode.c, src/threadget.c, src/threadhandler.c, src/threadidlebody.c, src/threadinitialize.c, src/threadloadenv.c, src/threadmp.c, src/threadq.c, src/threadqdequeue.c, src/threadqdequeuefifo.c, src/threadqdequeuepriority.c, src/threadqenqueue.c, src/threadqenqueuefifo.c, src/threadqenqueuepriority.c, src/threadqextract.c, src/threadqextractfifo.c, src/threadqextractpriority.c, src/threadqextractwithproxy.c, src/threadqfirst.c, src/threadqfirstfifo.c, src/threadqfirstpriority.c, src/threadqflush.c, src/threadqtimeout.c, src/threadready.c, src/threadreset.c, src/threadresettimeslice.c, src/threadrestart.c, src/threadresume.c, src/threadrotatequeue.c, src/threadsetpriority.c, src/threadsetstate.c, src/threadsettransient.c, src/threadstackallocate.c, src/threadstackfree.c, src/threadstart.c, src/threadstartmultitasking.c, src/threadsuspend.c, src/threadtickletimeslice.c, src/threadyieldprocessor.c, src/userext.c, src/watchdog.c, src/watchdogadjust.c, src/watchdoginsert.c, src/watchdogremove.c, src/watchdogtickle.c, src/wkspace.c: URL for license changed.
2001-08-302001-08-30 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-14/+12
* src/coremutex.c, src/coremutexseize.c, src/coremutexsurrender.c, inline/rtems/score/coremutex.inl: The per thread field resource_count should only be manipulated when a mutex is priority ceiling or priority inherit. This was reported by Chris Johns <ccj@acm.org> who also noticed that the use of switches for all disciplines generated less efficient code than using explicit tests for the one or two cases we were really interested in. Further review of his modifications made it apparent that the "isa" methods to test mutex discipline were not being used so this modification was swept into the code as well.
2001-08-162001-08-16 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-1/+1
* src/coremutexsurrender.c: Use holder thread not executing thread because even though they may and often are the same it is not guaranteed unless the proper attribute is set.
2000-07-06Format of return line changed.Joel Sherrill1-3/+3