22 #define OPAL_THREAD_H 1
24 #include "opal_config.h"
26 #if OPAL_HAVE_POSIX_THREADS
28 #elif OPAL_HAVE_SOLARIS_THREADS
38 #include "condition.h"
44 #define OPAL_THREAD_CANCELLED ((void*)1);
48 opal_thread_fn_t t_run;
52 #elif OPAL_HAVE_POSIX_THREADS
54 #elif OPAL_HAVE_SOLARIS_THREADS
62 OPAL_DECLSPEC
extern bool opal_debug_threads;
69 #define OPAL_ACQUIRE_THREAD(lck, cnd, act) \
71 OPAL_THREAD_LOCK((lck)); \
72 if (opal_debug_threads) { \
73 opal_output(0, "Waiting for thread %s:%d", \
74 __FILE__, __LINE__); \
77 opal_condition_wait((cnd), (lck)); \
79 if (opal_debug_threads) { \
80 opal_output(0, "Thread obtained %s:%d", \
81 __FILE__, __LINE__); \
86 #define OPAL_ACQUIRE_THREAD(lck, cnd, act) \
88 OPAL_THREAD_LOCK((lck)); \
90 opal_condition_wait((cnd), (lck)); \
98 #define OPAL_RELEASE_THREAD(lck, cnd, act) \
100 if (opal_debug_threads) { \
101 opal_output(0, "Releasing thread %s:%d", \
102 __FILE__, __LINE__); \
105 opal_condition_broadcast((cnd)); \
106 OPAL_THREAD_UNLOCK((lck)); \
109 #define OPAL_RELEASE_THREAD(lck, cnd, act) \
112 opal_condition_broadcast((cnd)); \
113 OPAL_THREAD_UNLOCK((lck)); \
118 #define OPAL_WAKEUP_THREAD(cnd, act) \
121 opal_condition_broadcast((cnd)); \
126 OPAL_DECLSPEC
int opal_thread_join(
opal_thread_t *,
void **thread_return);
129 OPAL_DECLSPEC
void opal_thread_kill(
opal_thread_t *,
int sig);
OPAL output stream facility.
Functions for multi-threaded applications using Libevent.
Base object.
Definition: opal_object.h:182
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236