21 #ifndef ORTE_CONDITION_H
22 #define ORTE_CONDITION_H
24 #include "orte_config.h"
25 #ifdef HAVE_SYS_TIME_H
31 #if OPAL_HAVE_POSIX_THREADS
33 #elif OPAL_HAVE_SOLARIS_THREADS
38 #include "opal/threads/threads.h"
61 OPAL_CR_TEST_CHECKPOINT_READY_STALL();
65 while (c->c_signaled == 0) {
68 OPAL_CR_TEST_CHECKPOINT_READY_STALL();
83 #define ORTE_CONDITION_WAIT(x, y) \
85 if (opal_debug_threads) { \
86 opal_output(0, "Entering condition wait for %s at %s:%d", \
87 (NULL == (x)->name) ? "NULL" : (x)->name, \
88 __FILE__, __LINE__); \
90 orte_condition_wait((x), (y)); \
93 #define ORTE_CONDITION_WAIT(x, y) orte_condition_wait(x, y)
102 struct timeval absolute;
113 absolute.tv_sec = abstime->tv_sec;
114 absolute.tv_usec = abstime->tv_nsec * 1000;
115 gettimeofday(&tv,NULL);
116 if (c->c_signaled == 0) {
120 gettimeofday(&tv,NULL);
122 }
while (c->c_signaled == 0 &&
123 (tv.tv_sec <= absolute.tv_sec ||
124 (tv.tv_sec == absolute.tv_sec && tv.tv_usec < absolute.tv_usec)));
131 if (c->c_signaled != 0) c->c_signaled--;
151 #if OPAL_ENABLE_DEBUG
152 #define ORTE_CONDITION_SIGNAL(x) \
154 if (opal_debug_threads) { \
155 opal_output(0, "Signaling condition %s at %s:%d", \
156 (NULL == (x)->name) ? "NULL" : (x)->name, \
157 __FILE__, __LINE__); \
159 orte_condition_signal((x)); \
162 #define ORTE_CONDITION_SIGNAL(x) orte_condition_signal(x)
167 c->c_signaled = c->c_waiting;
182 #if OPAL_ENABLE_DEBUG
183 #define ORTE_CONDITION_BROADCAST(x) \
185 if (opal_debug_threads) { \
186 opal_output(0, "Broadcasting condition %s at %s:%d", \
187 (NULL == (x)->name) ? "NULL" : (x)->name, \
188 __FILE__, __LINE__); \
190 orte_condition_broadcast((x)); \
193 #define ORTE_CONDITION_BROADCAST(x) orte_condition_broadcast(x)
static void opal_mutex_lock(opal_mutex_t *mutex)
Acquire a mutex.
Definition: condition.h:49
Definition: mutex_unix.h:53
Functions for multi-threaded applications using Libevent.
static void opal_mutex_unlock(opal_mutex_t *mutex)
Release a mutex.
Global params for OpenRTE.
Definition: ompi_time.h:160
OPAL_DECLSPEC void opal_progress(void)
Progress all pending events.
Definition: opal_progress.c:165
Checkpoint functionality for Open MPI.