source: rtems/cpukit/score/src/coremutexseize.c @ 04dba49

4.104.114.84.95
Last change on this file since 04dba49 was 04dba49, checked in by Joel Sherrill <joel.sherrill@…>, on 10/19/06 at 19:20:10

2006-10-19 Joel Sherrill <joel@…>

  • configure.ac, itron/Makefile.am, itron/preinstall.am, posix/Makefile.am, posix/preinstall.am, rtems/Makefile.am, rtems/preinstall.am, sapi/Makefile.am, sapi/preinstall.am, score/Makefile.am, score/preinstall.am, score/include/rtems/system.h, score/include/rtems/score/chain.h, score/include/rtems/score/thread.h, score/src/chain.c, score/src/coremutexseize.c, score/src/threadget.c: Remove all macro implementations and use only the static inline. Static inline functions are now well supported so there is no reason for duplicate maintenance.
  • itron/macros/rtems/itron/eventflags.inl, itron/macros/rtems/itron/fmempool.inl, itron/macros/rtems/itron/intr.inl, itron/macros/rtems/itron/mbox.inl, itron/macros/rtems/itron/msgbuffer.inl, itron/macros/rtems/itron/network.inl, itron/macros/rtems/itron/port.inl, itron/macros/rtems/itron/semaphore.inl, itron/macros/rtems/itron/sysmgmt.inl, itron/macros/rtems/itron/task.inl, itron/macros/rtems/itron/time.inl, itron/macros/rtems/itron/vmempool.inl, posix/macros/rtems/posix/cond.inl, posix/macros/rtems/posix/key.inl, posix/macros/rtems/posix/mqueue.inl, posix/macros/rtems/posix/mutex.inl, posix/macros/rtems/posix/priority.inl, posix/macros/rtems/posix/pthread.inl, posix/macros/rtems/posix/semaphore.inl, posix/macros/rtems/posix/timer.inl, rtems/macros/rtems/rtems/asr.inl, rtems/macros/rtems/rtems/attr.inl, rtems/macros/rtems/rtems/barrier.inl, rtems/macros/rtems/rtems/dpmem.inl, rtems/macros/rtems/rtems/event.inl, rtems/macros/rtems/rtems/eventset.inl, rtems/macros/rtems/rtems/message.inl, rtems/macros/rtems/rtems/modes.inl, rtems/macros/rtems/rtems/options.inl, rtems/macros/rtems/rtems/part.inl, rtems/macros/rtems/rtems/ratemon.inl, rtems/macros/rtems/rtems/region.inl, rtems/macros/rtems/rtems/sem.inl, rtems/macros/rtems/rtems/status.inl, rtems/macros/rtems/rtems/support.inl, rtems/macros/rtems/rtems/tasks.inl, rtems/macros/rtems/rtems/timer.inl, sapi/macros/rtems/extension.inl, score/macros/README, score/macros/rtems/score/address.inl, score/macros/rtems/score/chain.inl, score/macros/rtems/score/corebarrier.inl, score/macros/rtems/score/coremsg.inl, score/macros/rtems/score/coremutex.inl, score/macros/rtems/score/corerwlock.inl, score/macros/rtems/score/coresem.inl, score/macros/rtems/score/corespinlock.inl, score/macros/rtems/score/heap.inl, score/macros/rtems/score/isr.inl, score/macros/rtems/score/mppkt.inl, score/macros/rtems/score/object.inl, score/macros/rtems/score/objectmp.inl, score/macros/rtems/score/priority.inl, score/macros/rtems/score/stack.inl, score/macros/rtems/score/states.inl, score/macros/rtems/score/sysstate.inl, score/macros/rtems/score/thread.inl, score/macros/rtems/score/threadmp.inl, score/macros/rtems/score/tod.inl, score/macros/rtems/score/tqdata.inl, score/macros/rtems/score/userext.inl, score/macros/rtems/score/watchdog.inl, score/macros/rtems/score/wkspace.inl: Removed.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  Mutex Handler
3 *
4 *  DESCRIPTION:
5 *
6 *  This package is the implementation of the Mutex Handler.
7 *  This handler provides synchronization and mutual exclusion capabilities.
8 *
9 *  COPYRIGHT (c) 1989-2006.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#if HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include <rtems/system.h>
24#include <rtems/score/isr.h>
25#include <rtems/score/coremutex.h>
26#include <rtems/score/states.h>
27#include <rtems/score/thread.h>
28#include <rtems/score/threadq.h>
29
30/*PAGE
31 *
32 *  _CORE_mutex_Seize (interrupt blocking support)
33 *
34 *  This routine blocks the caller thread after an attempt attempts to obtain
35 *  the specified mutex has failed.
36 *
37 *  Input parameters:
38 *    the_mutex - pointer to mutex control block
39 *    timeout   - number of ticks to wait (0 means forever)
40 */
41
42void _CORE_mutex_Seize_interrupt_blocking(
43  CORE_mutex_Control  *the_mutex,
44  Watchdog_Interval    timeout
45)
46{
47  Thread_Control   *executing;
48
49  executing = _Thread_Executing;
50  if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ) {
51    if ( the_mutex->holder->current_priority > executing->current_priority ) {
52      _Thread_Change_priority(
53        the_mutex->holder,
54        executing->current_priority,
55        FALSE
56      );
57    }
58  }
59
60  the_mutex->blocked_count++;
61  _Thread_queue_Enqueue( &the_mutex->Wait_queue, timeout );
62
63  _Thread_Enable_dispatch();
64}
65
Note: See TracBrowser for help on using the repository browser.