source: rtems/cpukit/score/src/allocatormutex.c @ ab02824

Last change on this file since ab02824 was ab02824, checked in by Joel Sherrill <joel@…>, on 02/16/22 at 21:09:06

score/src/[a-m]*.c: Change license to BSD-2

Updates #3053.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @ingroup RTEMSScoreAPIMutex
7 *
8 * @brief This source file contains the implementation of
9 *   _RTEMS_Lock_allocator(), _RTEMS_Unlock_allocator(), and
10 *   _RTEMS_Allocator_is_owner().
11 */
12
13/*
14 * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
15 *
16 *  embedded brains GmbH
17 *  Dornierstr. 4
18 *  82178 Puchheim
19 *  Germany
20 *  <rtems@embedded-brains.de>
21 *
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions
24 * are met:
25 * 1. Redistributions of source code must retain the above copyright
26 *    notice, this list of conditions and the following disclaimer.
27 * 2. Redistributions in binary form must reproduce the above copyright
28 *    notice, this list of conditions and the following disclaimer in the
29 *    documentation and/or other materials provided with the distribution.
30 *
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
35 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGE.
42 */
43
44#ifdef HAVE_CONFIG_H
45#include "config.h"
46#endif
47
48#include <rtems/score/apimutex.h>
49
50static API_Mutex_Control _RTEMS_Allocator_Mutex =
51  API_MUTEX_INITIALIZER( "_Allocator" );
52
53void _RTEMS_Lock_allocator( void )
54{
55  _API_Mutex_Lock( &_RTEMS_Allocator_Mutex );
56}
57
58void _RTEMS_Unlock_allocator( void )
59{
60  _API_Mutex_Unlock( &_RTEMS_Allocator_Mutex );
61}
62
63bool _RTEMS_Allocator_is_owner( void )
64{
65  return _API_Mutex_Is_owner( &_RTEMS_Allocator_Mutex );
66}
Note: See TracBrowser for help on using the repository browser.