source: rtems/cpukit/score/src/apimutexlock.c @ 469dc47

5
Last change on this file since 469dc47 was 8765c57, checked in by Sebastian Huber <sebastian.huber@…>, on 04/18/16 at 05:00:55

score: Remove id parameter _CORE_mutex_Seize()

Parameter was unused.

  • Property mode set to 100644
File size: 994 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Acquires the specified API mutex.
5 *
6 * @ingroup ScoreAPIMutex
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2007.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/score/apimutex.h>
23#include <rtems/score/coremuteximpl.h>
24#include <rtems/score/threadimpl.h>
25
26void _API_Mutex_Lock( API_Mutex_Control *the_mutex )
27{
28  bool previous_thread_life_protection;
29  ISR_lock_Context lock_context;
30
31  previous_thread_life_protection = _Thread_Set_life_protection( true );
32
33  _ISR_lock_ISR_disable( &lock_context );
34
35  _CORE_mutex_Seize(
36    &the_mutex->Mutex,
37    _Thread_Executing,
38    true,
39    0,
40    &lock_context
41  );
42
43  if ( the_mutex->Mutex.nest_count == 1 ) {
44    the_mutex->previous_thread_life_protection =
45      previous_thread_life_protection;
46  }
47}
Note: See TracBrowser for help on using the repository browser.