RTEMS
allocatormutex.c
1 /*
2  * Copyright (c) 2017 embedded brains GmbH. All rights reserved.
3  *
4  * embedded brains GmbH
5  * Dornierstr. 4
6  * 82178 Puchheim
7  * Germany
8  * <rtems@embedded-brains.de>
9  *
10  * The license and distribution terms for this file may be
11  * found in the file LICENSE in this distribution or at
12  * http://www.rtems.org/license/LICENSE.
13  */
14 
15 #ifdef HAVE_CONFIG_H
16 #include "config.h"
17 #endif
18 
19 #include <rtems/score/apimutex.h>
20 
21 static API_Mutex_Control _RTEMS_Allocator_Mutex =
22  API_MUTEX_INITIALIZER( "_Allocator" );
23 
24 void _RTEMS_Lock_allocator( void )
25 {
26  _API_Mutex_Lock( &_RTEMS_Allocator_Mutex );
27 }
28 
29 void _RTEMS_Unlock_allocator( void )
30 {
31  _API_Mutex_Unlock( &_RTEMS_Allocator_Mutex );
32 }
33 
34 bool _RTEMS_Allocator_is_owner( void )
35 {
36  return _API_Mutex_Is_owner( &_RTEMS_Allocator_Mutex );
37 }
bool _API_Mutex_Is_owner(const API_Mutex_Control *mutex)
Checks if the specified API mutex is owned by the executing thread.
void _API_Mutex_Lock(API_Mutex_Control *mutex)
Acquires the specified API mutex.
Definition: apimutexlock.c:25
API Mutex Handler API.
#define API_MUTEX_INITIALIZER(name)
Statically initialize an API mutex.
Definition: apimutex.h:58
void _API_Mutex_Unlock(API_Mutex_Control *mutex)
Releases the specified API mutex.
Control block used to manage each API mutex.
Definition: apimutex.h:42