Lines Matching refs:_clp
112 #define CONFIG_LOCK_INIT(_clp) \ argument
114 mutex_init((_clp)->cl_mutex, NULL, MUTEX_DEFAULT, \
116 cv_init((_clp)->cl_cv, NULL, CV_DEFAULT, NULL); \
119 #define CONFIG_LOCK_FINI(_clp) \ argument
121 mutex_destroy((_clp)->cl_mutex); \
122 cv_destroy((_clp)->cl_cv); \
125 #define CONFIG_LOCK_ENTER(_clp, _rw) \ argument
127 mutex_enter((_clp)->cl_mutex); \
129 while ((_clp)->cl_reader || \
130 ((_clp)->cl_owner != NULL && \
131 (_clp)->cl_owner != curthread)) \
132 cv_wait((_clp)->cl_cv, \
133 (_clp)->cl_mutex); \
134 (_clp)->cl_owner = curthread; \
135 (_clp)->cl_writers++; \
138 while ((_clp)->cl_reader || \
139 (_clp)->cl_writers > 0) { \
140 ASSERT((_clp)->cl_owner != curthread); \
141 cv_wait((_clp)->cl_cv, \
142 (_clp)->cl_mutex); \
144 (_clp)->cl_owner = curthread; \
145 (_clp)->cl_reader = B_TRUE; \
147 mutex_exit((_clp)->cl_mutex); \
150 #define CONFIG_LOCK_EXIT(_clp) \ argument
152 mutex_enter((_clp)->cl_mutex); \
153 if ((_clp)->cl_reader) { \
154 (_clp)->cl_reader = B_FALSE; \
155 (_clp)->cl_owner = NULL; \
156 cv_broadcast((_clp)->cl_cv); \
158 ASSERT((_clp)->cl_writers != 0); \
159 (_clp)->cl_writers--; \
160 if ((_clp)->cl_writers == 0) { \
161 (_clp)->cl_owner = NULL; \
162 cv_broadcast((_clp)->cl_cv); \
165 mutex_exit((_clp)->cl_mutex); \
170 #define CONFIG_LOCK_INIT(_clp) argument
171 #define CONFIG_LOCK_FINI(_clp) argument
172 #define CONFIG_LOCK_ENTER(_clp, _rw) argument
173 #define CONFIG_LOCK_EXIT(_clp) argument