ubinos
condv.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 Sung Ho Park
3  Contact: ubinos.org@gmail.com
4 
5  This file is part of the itf_ubinos component of the Ubinos.
6 
7  GNU General Public License Usage
8  This file may be used under the terms of the GNU
9  General Public License version 3.0 as published by the Free Software
10  Foundation and appearing in the file license_gpl3.txt included in the
11  packaging of this file. Please review the following information to
12  ensure the GNU General Public License version 3.0 requirements will be
13  met: http://www.gnu.org/copyleft/gpl.html.
14 
15  GNU Lesser General Public License Usage
16  Alternatively, this file may be used under the terms of the GNU Lesser
17  General Public License version 2.1 as published by the Free Software
18  Foundation and appearing in the file license_lgpl.txt included in the
19  packaging of this file. Please review the following information to
20  ensure the GNU Lesser General Public License version 2.1 requirements
21  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22 
23  Commercial Usage
24  Alternatively, licensees holding valid commercial licenses may
25  use this file in accordance with the commercial license agreement
26  provided with the software or, alternatively, in accordance with the
27  terms contained in a written agreement between you and rightful owner.
28  */
29 
30 #ifndef UBIK_CONDV_H_
31 #define UBIK_CONDV_H_
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37 
53 #include <ubinos_config.h>
54 #include <ubinos/type.h>
55 
56 #include "task.h"
57 #include "mutex.h"
58 
60 typedef struct __condv_tip_t
61 {
62  unsigned int type :8;
63  unsigned int valid :1;
64  unsigned int reserved :7;
65  unsigned int reserved2 :16;
66 } _condv_tip_t;
67 
70 
81 int condv_create(condv_pt * condv_p);
82 
96 int condv_create_ext(condv_pt * condv_p, unsigned int option);
97 
109 int condv_delete(condv_pt * condv_p);
110 
125 int condv_wait(condv_pt condv, mutex_pt mutex);
126 
144 int condv_wait_timed(condv_pt condv, mutex_pt mutex, unsigned int tick);
145 
163 int condv_wait_timedms(condv_pt condv, mutex_pt mutex, unsigned int timems);
164 
175 int condv_signal(condv_pt condv);
176 
187 int condv_broadcast(condv_pt condv);
188 
202 int condv_setsender(condv_pt condv, task_pt task);
203 
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 #endif /* UBIK_CONDV_H_ */
task.h
ubik task API
__condv_tip_t::valid
unsigned int valid
Definition: condv.h:63
condv_delete
int condv_delete(condv_pt *condv_p)
condv_broadcast
int condv_broadcast(condv_pt condv)
__condv_tip_t::reserved
unsigned int reserved
Definition: condv.h:64
__condv_tip_t::type
unsigned int type
Definition: condv.h:62
_condv_tip_t
struct __condv_tip_t _condv_tip_t
type.h
ubinos basic data type
condv_wait_timedms
int condv_wait_timedms(condv_pt condv, mutex_pt mutex, unsigned int timems)
__task_tip_t
Definition: task.h:361
condv_create_ext
int condv_create_ext(condv_pt *condv_p, unsigned int option)
__mutex_tip_t
Definition: mutex.h:257
condv_create
int condv_create(condv_pt *condv_p)
condv_setsender
int condv_setsender(condv_pt condv, task_pt task)
__condv_tip_t
Definition: condv.h:60
condv_signal
int condv_signal(condv_pt condv)
mutex.h
ubik mutex API
condv_pt
_condv_tip_t * condv_pt
Definition: condv.h:69
condv_wait
int condv_wait(condv_pt condv, mutex_pt mutex)
condv_wait_timed
int condv_wait_timed(condv_pt condv, mutex_pt mutex, unsigned int tick)
__condv_tip_t::reserved2
unsigned int reserved2
Definition: condv.h:65