1 /* Copyright (c) 2003-2005 MySQL AB
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16 #ifndef NDB_CONDITION_H
17 #define NDB_CONDITION_H
31 * returnvalue: pointer to the condition structure
33 struct NdbCondition
* NdbCondition_Create(void);
36 * Wait for a condition, allows a thread to wait for
37 * a condition and atomically releases the associated mutex.
39 * p_cond: pointer to the condition structure
40 * p_mutex: pointer to the mutex structure
41 * returnvalue: 0 = succeeded, 1 = failed
43 int NdbCondition_Wait(struct NdbCondition
* p_cond
,
47 * Wait for a condition with timeout, allows a thread to
48 * wait for a condition and atomically releases the associated mutex.
50 * @param p_cond - pointer to the condition structure
51 * @param p_mutex - pointer to the mutex structure
52 * @param msec - Wait for msec milli seconds the most
53 * @return 0 = succeeded, 1 = failed
57 NdbCondition_WaitTimeout(struct NdbCondition
* p_cond
,
65 * p_cond: pointer to the condition structure
66 * returnvalue: 0 = succeeded, 1 = failed
68 int NdbCondition_Signal(struct NdbCondition
* p_cond
);
72 * Broadcast a condition
74 * p_cond: pointer to the condition structure
75 * returnvalue: 0 = succeeded, 1 = failed
77 int NdbCondition_Broadcast(struct NdbCondition
* p_cond
);
82 * p_cond: pointer to the condition structure
83 * returnvalue: 0 = succeeded, 1 = failed
85 int NdbCondition_Destroy(struct NdbCondition
* p_cond
);