source: rtems/cpukit/score/src/corerwlock.c @ 9c191ee

4.104.114.84.95
Last change on this file since 9c191ee was 9c191ee, checked in by Joel Sherrill <joel.sherrill@…>, on 09/25/06 at 13:36:58
  • score/Makefile.am, score/preinstall.am, score/include/rtems/score/coresem.h, score/include/rtems/score/object.h, score/include/rtems/score/states.h, score/inline/rtems/score/coresem.inl: Add SuperCore? Barriers, SpinLocks? and a partial implementation of RWLocks.
  • score/include/rtems/score/corebarrier.h, score/include/rtems/score/corerwlock.h, score/include/rtems/score/corespinlock.h, score/inline/rtems/score/corebarrier.inl, score/inline/rtems/score/corerwlock.inl, score/inline/rtems/score/corespinlock.inl, score/macros/rtems/score/corebarrier.inl, score/macros/rtems/score/corerwlock.inl, score/macros/rtems/score/corespinlock.inl, score/src/corebarrier.c, score/src/corebarrierrelease.c, score/src/corebarrierwait.c, score/src/corerwlock.c, score/src/corerwlockobtainread.c, score/src/corerwlockobtainwrite.c, score/src/corerwlockrelease.c, score/src/corespinlock.c, score/src/corespinlockrelease.c, score/src/corespinlockwait.c: New files.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  SuperCore RWLock Handler
3 *
4 *  DESCRIPTION:
5 *
6 *  This package is part of the implementation of the SuperCore RWLock Handler.
7 *
8 *  COPYRIGHT (c) 1989-2006.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/system.h>
23#include <rtems/score/corerwlock.h>
24#include <rtems/score/states.h>
25#include <rtems/score/thread.h>
26#include <rtems/score/threadq.h>
27#if defined(RTEMS_MULTIPROCESSING)
28#include <rtems/score/mpci.h>
29#endif
30
31/*PAGE
32 *
33 *  _CORE_RWLock_Initialize
34 *
35 *  This function initialize a rwlock and sets the initial value based
36 *  on the given count.
37 *
38 *  Input parameters:
39 *    the_rwlock            - the rwlock control block to initialize
40 *    the_rwlock_attributes - the attributes specified at create time
41 *
42 *  Output parameters:  NONE
43 */
44
45void _CORE_RWLock_Initialize(
46  CORE_RWLock_Control       *the_rwlock,
47  CORE_RWLock_Attributes    *the_rwlock_attributes
48)
49{
50
51  the_rwlock->Attributes                = *the_rwlock_attributes;
52/*
53  the_rwlock->number_of_waiting_threads = 0;
54*/
55
56  _Thread_queue_Initialize(
57    &the_rwlock->Wait_queue,
58    THREAD_QUEUE_DISCIPLINE_FIFO,
59    STATES_WAITING_FOR_RWLOCK,
60    CORE_RWLOCK_TIMEOUT
61  );
62}
Note: See TracBrowser for help on using the repository browser.