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

5
Last change on this file since fce900b5 was 6c2b8a4b, checked in by Sebastian Huber <sebastian.huber@…>, on 11/29/17 at 05:23:27

score: Use self-contained API mutex

Use a self-contained recursive mutex for API_Mutex_Control. The API
mutexes are protected against asynchronous thread cancellation.

Add dedicated mutexes for libatomic and TOD.

Close #2629.
Close #2630.

  • Property mode set to 100644
File size: 790 bytes
Line 
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#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/score/apimutex.h>
20
21static API_Mutex_Control _RTEMS_Allocator_Mutex =
22  API_MUTEX_INITIALIZER( "_Allocator" );
23
24void _RTEMS_Lock_allocator( void )
25{
26  _API_Mutex_Lock( &_RTEMS_Allocator_Mutex );
27}
28
29void _RTEMS_Unlock_allocator( void )
30{
31  _API_Mutex_Unlock( &_RTEMS_Allocator_Mutex );
32}
33
34bool _RTEMS_Allocator_is_owner( void )
35{
36  return _API_Mutex_Is_owner( &_RTEMS_Allocator_Mutex );
37}
Note: See TracBrowser for help on using the repository browser.