Skip to content

Commit c13f214

Browse files
committed
Do not use mutex lock during init-finalise-registration of mca-sources
Signed-off-by: Kingshuk Haldar <kingshuk.haldar@hlrs.de>
1 parent c504656 commit c13f214

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

opal/mca/base/mca_base_source.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,19 @@ int mca_base_source_init (void)
6262
{
6363
int ret = OPAL_SUCCESS;
6464

65-
OPAL_THREAD_LOCK(&mca_base_source_lock);
66-
6765
if (false == mca_base_source_initialized) {
6866
mca_base_source_initialized = true;
6967

7068
OBJ_CONSTRUCT(&registered_sources, opal_pointer_array_t);
7169
opal_pointer_array_init(&registered_sources, 16, 512, 16);
7270

73-
OPAL_THREAD_UNLOCK(&mca_base_source_lock);
74-
7571
/* mca_base_source_register will use lock */
7672
mca_base_source_default_source = mca_base_source_register ("opal", "mca", "base", "default_source",
7773
"Default source for MCA events", true,
7874
mca_base_source_default_time_source,
7975
mca_base_source_default_time_source_ticks ());
8076

8177
}
82-
else
83-
OPAL_THREAD_UNLOCK(&mca_base_source_lock);
8478

8579
return ret;
8680
}
@@ -89,7 +83,6 @@ int mca_base_source_finalize (void)
8983
{
9084
int i;
9185

92-
OPAL_THREAD_LOCK(&mca_base_source_lock);
9386
if (true == mca_base_source_initialized) {
9487
for (i = 0 ; i < source_count ; ++i) {
9588
mca_base_source_t *source = opal_pointer_array_get_item (&registered_sources, i);
@@ -103,7 +96,6 @@ int mca_base_source_finalize (void)
10396
OBJ_DESTRUCT(&registered_sources);
10497
mca_base_source_initialized = false;
10598
}
106-
OPAL_THREAD_UNLOCK(&mca_base_source_lock);
10799

108100
return OPAL_SUCCESS;
109101
}
@@ -188,12 +180,9 @@ int mca_base_source_register (const char *project, const char *framework, const
188180
char *source_name;
189181
int ret;
190182

191-
OPAL_THREAD_LOCK(&mca_base_source_lock);
192-
193183
/* generate the variable's full name */
194184
ret = mca_base_var_generate_full_name4 (NULL, framework, component, name, &source_name);
195185
if (OPAL_SUCCESS != ret) {
196-
OPAL_THREAD_UNLOCK(&mca_base_source_lock);
197186
return ret;
198187
}
199188

@@ -204,7 +193,6 @@ int mca_base_source_register (const char *project, const char *framework, const
204193
/* create a new parameter entry */
205194
source = OBJ_NEW(mca_base_source_t);
206195
if (NULL == source) {
207-
OPAL_THREAD_UNLOCK(&mca_base_source_lock);
208196
return OPAL_ERR_OUT_OF_RESOURCE;
209197
}
210198

@@ -231,7 +219,6 @@ int mca_base_source_register (const char *project, const char *framework, const
231219

232220
if (OPAL_SUCCESS != ret) {
233221
OBJ_RELEASE(source);
234-
OPAL_THREAD_UNLOCK(&mca_base_source_lock);
235222
return ret;
236223
}
237224
} else {
@@ -247,8 +234,6 @@ int mca_base_source_register (const char *project, const char *framework, const
247234
source->source_time = source_time;
248235
source->source_ticks = source_ticks;
249236

250-
OPAL_THREAD_UNLOCK(&mca_base_source_lock);
251-
252237
return OPAL_SUCCESS;
253238
}
254239
int mca_base_component_source_register (const mca_base_component_t *component, const char *name, const char *description, bool ordered,

0 commit comments

Comments
 (0)