Skip to content

Commit a78b399

Browse files
committed
avoid holding lock on return and opal_output debug
Signed-off-by: Thomas Naughton <[email protected]>
1 parent f6f66c8 commit a78b399

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ompi/errhandler/errcode.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ int ompi_mpi_errcode_remove(int errnum)
429429

430430
errcodep = (ompi_mpi_errcode_t *)opal_pointer_array_get_item(&ompi_mpi_errcodes, errnum);
431431
if ( NULL == errcodep ) {
432+
opal_mutex_unlock(&errcode_lock);
432433
return OMPI_ERROR;
433434
}
434435

@@ -442,9 +443,6 @@ int ompi_mpi_errcode_remove(int errnum)
442443
}
443444
}
444445
}
445-
} else {
446-
opal_output(0, "Error: must clear errstring before delete error code %d", errnum);
447-
ret = OMPI_ERROR;
448446
}
449447

450448
opal_mutex_unlock(&errcode_lock);
@@ -461,6 +459,7 @@ int ompi_mpi_errclass_remove(int errclass)
461459

462460
errcodep = (ompi_mpi_errcode_t *)opal_pointer_array_get_item(&ompi_mpi_errcodes, errclass);
463461
if ( NULL == errcodep ) {
462+
opal_mutex_unlock(&errcode_lock);
464463
return OMPI_ERROR;
465464
}
466465

@@ -477,9 +476,6 @@ int ompi_mpi_errclass_remove(int errclass)
477476
}
478477
}
479478
}
480-
} else {
481-
opal_output(0, "Error: must clear errstring before delete error class %d", errclass);
482-
ret = OMPI_ERROR;
483479
}
484480

485481
opal_mutex_unlock(&errcode_lock);
@@ -489,13 +485,13 @@ int ompi_mpi_errclass_remove(int errclass)
489485

490486
int ompi_mpi_errnum_remove_string(int errnum)
491487
{
492-
int ret = OMPI_SUCCESS;
493488
ompi_mpi_errcode_t *errcodep = NULL;
494489

495490
opal_mutex_lock(&errcode_lock);
496491

497492
errcodep = (ompi_mpi_errcode_t *)opal_pointer_array_get_item(&ompi_mpi_errcodes, errnum);
498493
if ( NULL == errcodep ) {
494+
opal_mutex_unlock(&errcode_lock);
499495
return OMPI_ERROR;
500496
}
501497

@@ -505,7 +501,7 @@ int ompi_mpi_errnum_remove_string(int errnum)
505501

506502
opal_mutex_unlock(&errcode_lock);
507503

508-
return ret;
504+
return OMPI_SUCCESS;
509505
}
510506

511507
static void ompi_mpi_errcode_construct(ompi_mpi_errcode_t *errcode)

0 commit comments

Comments
 (0)