Skip to content

Commit ca2f98e

Browse files
Noah Evanshppritcha
authored andcommitted
fix thread_usage.h
Signed-off-by: Noah Evans <nevans@sandia.gov>
1 parent 0f6541b commit ca2f98e

File tree

12 files changed

+147
-563
lines changed

12 files changed

+147
-563
lines changed

opal/mca/threads/base/Makefile.am

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
#
2020

2121
headers += \
22-
base/base.h \
23-
base/threads_base_null.h
22+
base/base.h
2423

2524
libmca_threads_la_SOURCES += \
2625
base/threads_base_open.c

opal/mca/threads/base/threads_base_null.h

Lines changed: 0 additions & 54 deletions
This file was deleted.

opal/mca/threads/configure.m4

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@ AC_DEFUN([MCA_opal_threads_CONFIG],[
3535
# first, compile all the components
3636
MCA_CONFIGURE_FRAMEWORK($1, $2, 1)
3737

38-
# someone should have set this...
39-
if test "$threads_base_include" = "" ; then
40-
threads_base_include="base/threads_base_null.h"
41-
fi
42-
4338
if test "$mutex_base_include" = "" ; then
44-
# mutex_base_include="base/mutex_base_null.h"
4539
mutex_base_include="pthreads/mutex_unix.h"
4640
fi
4741
AC_DEFINE_UNQUOTED([MCA_threads_IMPLEMENTATION_HEADER],

opal/mca/threads/mutex.h

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,26 @@
2929

3030
#include "opal_config.h"
3131

32-
#include MCA_mutex_IMPLEMENTATION_HEADER
33-
34-
BEGIN_C_DECLS
35-
3632
/**
37-
* @file:
33+
* @file:
3834
*
3935
* Mutual exclusion functions.
4036
*
4137
* Functions for locking of critical sections.
4238
*/
4339

40+
4441
/**
4542
* Opaque mutex object
4643
*/
44+
4745
typedef struct opal_mutex_t opal_mutex_t;
4846
typedef struct opal_mutex_t opal_recursive_mutex_t;
4947

48+
BEGIN_C_DECLS
49+
#include MCA_mutex_IMPLEMENTATION_HEADER
50+
END_C_DECLS
51+
5052
OBJ_CLASS_DECLARATION(opal_mutex_t);
5153
OBJ_CLASS_DECLARATION(opal_recursive_mutex_t);
5254

@@ -100,11 +102,6 @@ static inline void opal_mutex_atomic_lock(opal_mutex_t *mutex);
100102
*/
101103
static inline void opal_mutex_atomic_unlock(opal_mutex_t *mutex);
102104

103-
END_C_DECLS
104-
105-
#include MCA_mutex_IMPLEMENTATION_HEADER
106-
107-
BEGIN_C_DECLS
108105

109106
/**
110107
* Lock a mutex if opal_using_threads() says that multiple threads may

opal/mca/threads/pthreads/mutex_unix.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_recursive_mutex_t);
118118
*
119119
************************************************************************/
120120

121-
static inline int opal_mutex_trylock(struct opal_mutex_t *m)
121+
static inline int opal_mutex_trylock(opal_mutex_t *m)
122122
{
123123
#if OPAL_ENABLE_DEBUG
124124
int ret = pthread_mutex_trylock(&m->m_lock_pthread);
@@ -133,7 +133,7 @@ static inline int opal_mutex_trylock(struct opal_mutex_t *m)
133133
#endif
134134
}
135135

136-
static inline void opal_mutex_lock(struct opal_mutex_t *m)
136+
static inline void opal_mutex_lock(opal_mutex_t *m)
137137
{
138138
#if OPAL_ENABLE_DEBUG
139139
int ret = pthread_mutex_lock(&m->m_lock_pthread);
@@ -147,7 +147,7 @@ static inline void opal_mutex_lock(struct opal_mutex_t *m)
147147
#endif
148148
}
149149

150-
static inline void opal_mutex_unlock(struct opal_mutex_t *m)
150+
static inline void opal_mutex_unlock(opal_mutex_t *m)
151151
{
152152
#if OPAL_ENABLE_DEBUG
153153
int ret = pthread_mutex_unlock(&m->m_lock_pthread);
@@ -173,17 +173,17 @@ static inline void opal_mutex_unlock(struct opal_mutex_t *m)
173173
* Spin Locks
174174
************************************************************************/
175175

176-
static inline int opal_mutex_atomic_trylock(struct opal_mutex_t *m)
176+
static inline int opal_mutex_atomic_trylock(opal_mutex_t *m)
177177
{
178178
return opal_atomic_trylock(&m->m_lock_atomic);
179179
}
180180

181-
static inline void opal_mutex_atomic_lock(struct opal_mutex_t *m)
181+
static inline void opal_mutex_atomic_lock(opal_mutex_t *m)
182182
{
183183
opal_atomic_lock(&m->m_lock_atomic);
184184
}
185185

186-
static inline void opal_mutex_atomic_unlock(struct opal_mutex_t *m)
186+
static inline void opal_mutex_atomic_unlock(opal_mutex_t *m)
187187
{
188188
opal_atomic_unlock(&m->m_lock_atomic);
189189
}
@@ -194,17 +194,17 @@ static inline void opal_mutex_atomic_unlock(struct opal_mutex_t *m)
194194
* Standard locking
195195
************************************************************************/
196196

197-
static inline int opal_mutex_atomic_trylock(struct opal_mutex_t *m)
197+
static inline int opal_mutex_atomic_trylock(opal_mutex_t *m)
198198
{
199199
return opal_mutex_trylock(m);
200200
}
201201

202-
static inline void opal_mutex_atomic_lock(struct opal_mutex_t *m)
202+
static inline void opal_mutex_atomic_lock(opal_mutex_t *m)
203203
{
204204
opal_mutex_lock(m);
205205
}
206206

207-
static inline void opal_mutex_atomic_unlock(struct opal_mutex_t *m)
207+
static inline void opal_mutex_atomic_unlock(opal_mutex_t *m)
208208
{
209209
opal_mutex_unlock(m);
210210
}

opal/mca/threads/pthreads/threads_base_null.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

opal/mca/threads/pthreads/threads_pthreads_module.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ bool opal_thread_self_compare(opal_thread_t *t)
6060
return t->t_handle == pthread_self();
6161
}
6262

63-
int sync_wait_mt(void *p) {
64-
return 0;
65-
}
66-
6763
int opal_thread_join(opal_thread_t *t, void **thr_return) {
6864
int rc = pthread_join(t->t_handle, thr_return);
6965
t->t_handle = (pthread_t) -1;

opal/mca/threads/qthreads/threads_base_null.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

opal/mca/threads/qthreads/threads_base_null.htmp

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)