Skip to content

Commit fea82f5

Browse files
opal/mca/threads: minor cleanup
- Remove unnecessary "include" - Remove weird empty lines - Clean up parentheses for macros - Remove EDEADLK check for trylock() and unlock() Signed-off-by: Shintaro Iwasaki <[email protected]>
1 parent ffa421f commit fea82f5

File tree

6 files changed

+6
-23
lines changed

6 files changed

+6
-23
lines changed

opal/mca/threads/argobots/threads_argobots_mutex.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
#include "opal_config.h"
3333

34-
#include <errno.h>
3534
#include <stdio.h>
3635
#include <string.h>
3736

opal/mca/threads/base/mutex.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626

2727
#include "opal_config.h"
2828

29-
#include <errno.h>
30-
#include <pthread.h>
31-
3229
#include "opal/constants.h"
3330
#include "opal/mca/threads/mutex.h"
3431

opal/mca/threads/mutex.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ typedef struct opal_mutex_t opal_recursive_mutex_t;
5353

5454
struct opal_mutex_t {
5555
opal_object_t super;
56-
5756
opal_thread_internal_mutex_t m_lock;
58-
5957
#if OPAL_ENABLE_DEBUG
6058
int m_lock_debug;
6159
const char *m_lock_file;

opal/mca/threads/pthreads/threads_pthreads_mutex.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,13 @@ static inline void opal_thread_internal_mutex_lock(opal_thread_internal_mutex_t
121121
static inline int opal_thread_internal_mutex_trylock(opal_thread_internal_mutex_t *p_mutex)
122122
{
123123
int ret = pthread_mutex_trylock(p_mutex);
124-
#if OPAL_ENABLE_DEBUG
125-
if (EDEADLK == ret) {
126-
opal_output(0, "opal_thread_internal_mutex_trylock() %d", ret);
127-
return 1;
128-
}
129-
#endif
130124
return 0 == ret ? 0 : 1;
131-
;
132125
}
133126

134127
static inline void opal_thread_internal_mutex_unlock(opal_thread_internal_mutex_t *p_mutex)
135128
{
136129
#if OPAL_ENABLE_DEBUG
137130
int ret = pthread_mutex_unlock(p_mutex);
138-
if (EDEADLK == ret) {
139-
opal_output(0, "opal_thread_internal_mutex_unlock() %d", ret);
140-
}
141131
assert(0 == ret);
142132
#else
143133
pthread_mutex_unlock(p_mutex);

opal/mca/threads/qthreads/threads_qthreads_mutex.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#include "opal_config.h"
3434

35-
#include <errno.h>
3635
#include <stdio.h>
3736

3837
#include "opal/class/opal_object.h"

opal/mca/threads/wait_sync.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ typedef struct ompi_wait_sync_t {
7777
opal_thread_internal_mutex_destroy(&(sync)->lock); \
7878
}
7979

80-
#define WAIT_SYNC_SIGNAL(sync) \
81-
if (opal_using_threads()) { \
82-
opal_thread_internal_mutex_lock(&(sync->lock)); \
83-
opal_thread_internal_cond_signal(&sync->condition); \
84-
opal_thread_internal_mutex_unlock(&(sync->lock)); \
85-
sync->signaling = false; \
80+
#define WAIT_SYNC_SIGNAL(sync) \
81+
if (opal_using_threads()) { \
82+
opal_thread_internal_mutex_lock(&(sync)->lock); \
83+
opal_thread_internal_cond_signal(&(sync)->condition); \
84+
opal_thread_internal_mutex_unlock(&(sync)->lock); \
85+
(sync)->signaling = false; \
8686
}
8787

8888
#define WAIT_SYNC_SIGNALLED(sync) \

0 commit comments

Comments
 (0)