RTEMS: cpukit/include/rtems/rfs/rtems-rfs-mutex.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
rtems-rfs-mutex.h
Go to the documentation of this file.
1
14/*
15 * COPYRIGHT (c) 2010 Chris Johns <chrisj@rtems.org>
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.org/license/LICENSE.
20 */
21
22#if !defined (_RTEMS_RFS_MUTEX_H_)
23#define _RTEMS_RFS_MUTEX_H_
24
25#include <errno.h>
26
27#include <rtems/rfs/rtems-rfs-trace.h>
28
29#if __rtems__
30#include <rtems.h>
31#include <rtems/error.h>
32#include <rtems/thread.h>
33#endif
34
38#if __rtems__
39typedef rtems_recursive_mutex rtems_rfs_mutex;
40#else
41 typedef uint32_t rtems_rfs_mutex; /* place holder */
42#endif
43
53int rtems_rfs_mutex_create (rtems_rfs_mutex* mutex);
54
63int rtems_rfs_mutex_destroy (rtems_rfs_mutex* mutex);
64
73static inline int
74rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
75{
76#if __rtems__
77 rtems_recursive_mutex_lock(mutex);
78#endif
79 return 0;
80}
81
90static inline int
91rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
92{
93#if __rtems__
94 rtems_recursive_mutex_unlock(mutex);
95#endif
96 return 0;
97}
98
99#endif
error.h
RTEMS Error Reporting.
rtems_rfs_mutex_create
int rtems_rfs_mutex_create(rtems_rfs_mutex *mutex)
Create the mutex.
Definition: rtems-rfs-mutex.c:23
rtems_rfs_mutex
uint32_t rtems_rfs_mutex
Definition: rtems-rfs-mutex.h:41
rtems_rfs_mutex_destroy
int rtems_rfs_mutex_destroy(rtems_rfs_mutex *mutex)
Destroy the mutex.
Definition: rtems-rfs-mutex.c:32
rtems-rfs-trace.h
Manages the Trace and Debugging Features of the RTEMS RFS File System.
rtems.h
mutex
Definition: mutex.h:4