Mercury
mercury_thread_condition.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Argonne National Laboratory, Department of Energy,
3  *                    UChicago Argonne, LLC and The HDF Group.
4  * All rights reserved.
5  *
6  * The full copyright notice, including terms governing use, modification,
7  * and redistribution, is contained in the COPYING file that can be
8  * found at the root of the source code distribution tree.
9  */
10 
11 #ifndef MERCURY_THREAD_CONDITION_H
12 #define MERCURY_THREAD_CONDITION_H
13 
14 #include "mercury_thread_mutex.h"
15 
16 #ifdef _WIN32
17  typedef CONDITION_VARIABLE hg_thread_cond_t;
18 #else
19  typedef pthread_cond_t hg_thread_cond_t;
20 #endif
21 
29 HG_UTIL_EXPORT int
31 
39 HG_UTIL_EXPORT int
41 
49 HG_UTIL_EXPORT int
51 
59 HG_UTIL_EXPORT int
61 
70 HG_UTIL_EXPORT int
72 
82 HG_UTIL_EXPORT int
84  unsigned int timeout);
85 
86 #endif /* MERCURY_THREAD_CONDITION_H */
HG_UTIL_EXPORT int hg_thread_cond_destroy(hg_thread_cond_t *cond)
Destroy the condition.
HG_UTIL_EXPORT int hg_thread_cond_wait(hg_thread_cond_t *cond, hg_thread_mutex_t *mutex)
Wait for the condition to change.
HG_UTIL_EXPORT int hg_thread_cond_broadcast(hg_thread_cond_t *cond)
Wake all the threads waiting for the condition to change.
pthread_mutex_t hg_thread_mutex_t
HG_UTIL_EXPORT int hg_thread_cond_init(hg_thread_cond_t *cond)
Initialize the condition.
pthread_cond_t hg_thread_cond_t
HG_UTIL_EXPORT int hg_thread_cond_signal(hg_thread_cond_t *cond)
Wake one thread waiting for the condition to change.
HG_UTIL_EXPORT int hg_thread_cond_timedwait(hg_thread_cond_t *cond, hg_thread_mutex_t *mutex, unsigned int timeout)
Wait timeout ms for the condition to change.