Motr  M0
cond.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 
25 #ifndef __MOTR_LIB_COND_H__
26 #define __MOTR_LIB_COND_H__
27 
28 #include "chan.h"
29 
30 struct m0_mutex;
31 
99 struct m0_cond {
100  struct m0_chan c_chan;
101 };
102 
103 M0_INTERNAL void m0_cond_init(struct m0_cond *cond, struct m0_mutex *mutex);
104 M0_INTERNAL void m0_cond_fini(struct m0_cond *cond);
105 
113 M0_INTERNAL void m0_cond_wait(struct m0_cond *cond);
114 
129 M0_INTERNAL bool m0_cond_timedwait(struct m0_cond *cond,
130  const m0_time_t abs_timeout);
131 
137 M0_INTERNAL void m0_cond_signal(struct m0_cond *cond);
138 
144 M0_INTERNAL void m0_cond_broadcast(struct m0_cond *cond);
145 
148 /* __MOTR_LIB_COND_H__ */
149 #endif
150 
151 /*
152  * Local variables:
153  * c-indentation-style: "K&R"
154  * c-basic-offset: 8
155  * tab-width: 8
156  * fill-column: 80
157  * scroll-step: 1
158  * End:
159  */
Definition: cond.h:99
uint64_t m0_time_t
Definition: time.h:37
M0_INTERNAL void m0_cond_init(struct m0_cond *cond, struct m0_mutex *mutex)
Definition: cond.c:40
M0_INTERNAL void m0_cond_fini(struct m0_cond *cond)
Definition: cond.c:46
M0_INTERNAL void m0_cond_signal(struct m0_cond *cond)
Definition: cond.c:94
Definition: chan.h:229
M0_INTERNAL void m0_cond_wait(struct m0_cond *cond)
Definition: cond.c:52
struct m0_chan c_chan
Definition: cond.h:100
struct m0_mutex mutex
Definition: format.h:170
M0_INTERNAL bool m0_cond_timedwait(struct m0_cond *cond, const m0_time_t abs_timeout)
Definition: cond.c:74
M0_INTERNAL void m0_cond_broadcast(struct m0_cond *cond)
Definition: cond.c:100
Definition: mutex.h:47