RTEMS
apimutexisowner.c
Go to the documentation of this file.
1 
7 /*
8  * COPYRIGHT (c) 1989-2015.
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.org/license/LICENSE.
14  */
15 
16 #ifdef HAVE_CONFIG_H
17 #include "config.h"
18 #endif
19 
20 #include <rtems/score/apimutex.h>
21 #include <rtems/score/percpu.h>
22 
23 bool _API_Mutex_Is_owner( const API_Mutex_Control *the_mutex )
24 {
25  return the_mutex->Mutex._Mutex._Queue._owner == _Thread_Get_executing();
26 }
bool _API_Mutex_Is_owner(const API_Mutex_Control *the_mutex)
Checks if the specified API mutex is owned by the executing thread.
static __inline__ struct _Thread_Control * _Thread_Get_executing(void)
Returns the thread control block of the executing thread.
Definition: percpu.h:878
API Mutex Handler API.
Control block used to manage each API mutex.
Definition: apimutex.h:42
struct _Mutex_recursive_Control Mutex
Definition: apimutex.h:46