source: trunk/libs/newlib/src/newlib/libc/misc/lock.c @ 577

Last change on this file since 577 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 3.8 KB
Line 
1/*
2FUNCTION
3<<__retarget_lock_init>>, <<__retarget_lock_init_recursive>>, <<__retarget_lock_close>>, <<__retarget_lock_close_recursive>>, <<__retarget_lock_acquire>>, <<__retarget_lock_acquire_recursive>>, <<__retarget_lock_try_acquire>>, <<__retarget_lock_try_acquire_recursive>>, <<__retarget_lock_release>>, <<__retarget_lock_release_recursive>>---locking routines
4
5INDEX
6        __lock___sinit_recursive_mutex
7INDEX
8        __lock___sfp_recursive_mutex
9INDEX
10        __lock___atexit_recursive_mutex
11INDEX
12        __lock___at_quick_exit_mutex
13INDEX
14        __lock___malloc_recursive_mutex
15INDEX
16        __lock___env_recursive_mutex
17INDEX
18        __lock___tz_mutex
19INDEX
20        __lock___dd_hash_mutex
21INDEX
22        __lock___arc4random_mutex
23
24INDEX
25        __retarget_lock_init
26INDEX
27        __retarget_lock_init_recursive
28INDEX
29        __retarget_lock_close
30INDEX
31        __retarget_lock_close_recursive
32INDEX
33        __retarget_lock_acquire
34INDEX
35        __retarget_lock_acquire_recursive
36INDEX
37        __retarget_lock_try_acquire
38INDEX
39        __retarget_lock_try_acquire_recursive
40INDEX
41        __retarget_lock_release
42INDEX
43        __retarget_lock_release_recursive
44
45SYNOPSIS
46        #include <lock.h>
47        struct __lock __lock___sinit_recursive_mutex;
48        struct __lock __lock___sfp_recursive_mutex;
49        struct __lock __lock___atexit_recursive_mutex;
50        struct __lock __lock___at_quick_exit_mutex;
51        struct __lock __lock___malloc_recursive_mutex;
52        struct __lock __lock___env_recursive_mutex;
53        struct __lock __lock___tz_mutex;
54        struct __lock __lock___dd_hash_mutex;
55        struct __lock __lock___arc4random_mutex;
56
57        void __retarget_lock_init (_LOCK_T * <[lock_ptr]>);
58        void __retarget_lock_init_recursive (_LOCK_T * <[lock_ptr]>);
59        void __retarget_lock_close (_LOCK_T <[lock]>);
60        void __retarget_lock_close_recursive (_LOCK_T <[lock]>);
61        void __retarget_lock_acquire (_LOCK_T <[lock]>);
62        void __retarget_lock_acquire_recursive (_LOCK_T <[lock]>);
63        int __retarget_lock_try_acquire (_LOCK_T <[lock]>);
64        int __retarget_lock_try_acquire_recursive (_LOCK_T <[lock]>);
65        void __retarget_lock_release (_LOCK_T <[lock]>);
66        void __retarget_lock_release_recursive (_LOCK_T <[lock]>);
67
68DESCRIPTION
69Newlib was configured to allow the target platform to provide the locking
70routines and static locks at link time.  As such, a dummy default
71implementation of these routines and static locks is provided for
72single-threaded application to link successfully out of the box on bare-metal
73systems.
74
75For multi-threaded applications the target platform is required to provide
76an implementation for @strong{all} these routines and static locks.  If some
77routines or static locks are missing, the link will fail with doubly defined
78symbols.
79
80PORTABILITY
81These locking routines and static lock are newlib-specific.  Supporting OS
82subroutines are required for linking multi-threaded applications.
83*/
84
85/* dummy lock routines and static locks for single-threaded apps */
86
87#ifndef __SINGLE_THREAD__
88
89#include <sys/lock.h>
90
91struct __lock {
92  char unused;
93};
94
95struct __lock __lock___sinit_recursive_mutex;
96struct __lock __lock___sfp_recursive_mutex;
97struct __lock __lock___atexit_recursive_mutex;
98struct __lock __lock___at_quick_exit_mutex;
99struct __lock __lock___malloc_recursive_mutex;
100struct __lock __lock___env_recursive_mutex;
101struct __lock __lock___tz_mutex;
102struct __lock __lock___dd_hash_mutex;
103struct __lock __lock___arc4random_mutex;
104
105void
106__retarget_lock_init (_LOCK_T *lock)
107{
108}
109
110void
111__retarget_lock_init_recursive(_LOCK_T *lock)
112{
113}
114
115void
116__retarget_lock_close(_LOCK_T lock)
117{
118}
119
120void
121__retarget_lock_close_recursive(_LOCK_T lock)
122{
123}
124
125void
126__retarget_lock_acquire (_LOCK_T lock)
127{
128}
129
130void
131__retarget_lock_acquire_recursive (_LOCK_T lock)
132{
133}
134
135int
136__retarget_lock_try_acquire(_LOCK_T lock)
137{
138  return 1;
139}
140
141int
142__retarget_lock_try_acquire_recursive(_LOCK_T lock)
143{
144  return 1;
145}
146
147void
148__retarget_lock_release (_LOCK_T lock)
149{
150}
151
152void
153__retarget_lock_release_recursive (_LOCK_T lock)
154{
155}
156
157#endif /* !defined(__SINGLE_THREAD__) */
Note: See TracBrowser for help on using the repository browser.