* opal_atomic_trylock is documented to return 0 if the lock was acquired,
1 otherwise. It was doing the opposite, so this patch fixes the return values. All uses (all in ORTE) used the actual return values, not the documented values, so fix them as well. This commit was SVN r25257.
Этот коммит содержится в:
родитель
b88702f9b3
Коммит
98e98ce2c5
@ -357,8 +357,9 @@ opal_atomic_init( opal_atomic_lock_t* lock, int32_t value )
|
||||
static inline int
|
||||
opal_atomic_trylock(opal_atomic_lock_t *lock)
|
||||
{
|
||||
return opal_atomic_cmpset_acq_32( &(lock->u.lock),
|
||||
OPAL_ATOMIC_UNLOCKED, OPAL_ATOMIC_LOCKED);
|
||||
int ret = opal_atomic_cmpset_acq_32( &(lock->u.lock),
|
||||
OPAL_ATOMIC_UNLOCKED, OPAL_ATOMIC_LOCKED);
|
||||
return (ret == 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -493,7 +493,7 @@ static void default_hnp_abort(orte_jobid_t job, orte_exit_code_t exit_code)
|
||||
int rc;
|
||||
|
||||
/* if we are already in progress, then ignore this call */
|
||||
if (!opal_atomic_trylock(&orte_abort_inprogress_lock)) { /* returns 1 if already locked */
|
||||
if (opal_atomic_trylock(&orte_abort_inprogress_lock)) { /* returns 1 if already locked */
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_errmgr_base.output,
|
||||
"%s errmgr:default_hnp: abort in progress, ignoring abort on job %s with status %d",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
|
@ -1021,7 +1021,7 @@ static void hnp_abort(orte_jobid_t job, orte_exit_code_t exit_code)
|
||||
int rc;
|
||||
|
||||
/* if we are already in progress, then ignore this call */
|
||||
if (!opal_atomic_trylock(&orte_abort_inprogress_lock)) { /* returns 1 if already locked */
|
||||
if (opal_atomic_trylock(&orte_abort_inprogress_lock)) { /* returns 1 if already locked */
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_errmgr_base.output,
|
||||
"%s errmgr:hnp: abort in progress, ignoring abort on job %s with status %d",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
|
@ -1065,7 +1065,7 @@ static void abort_signal_callback(int fd, short flags, void *arg)
|
||||
/* if we have already ordered this once, don't keep
|
||||
* doing it to avoid race conditions
|
||||
*/
|
||||
if (!opal_atomic_trylock(&orte_abort_inprogress_lock)) { /* returns 1 if already locked */
|
||||
if (opal_atomic_trylock(&orte_abort_inprogress_lock)) { /* returns 1 if already locked */
|
||||
if (forcibly_die) {
|
||||
/* kill any local procs */
|
||||
orte_odls.kill_local_procs(NULL);
|
||||
|
@ -47,7 +47,7 @@ int orte_finalize(void)
|
||||
}
|
||||
|
||||
/* protect against multiple calls */
|
||||
if (!opal_atomic_trylock(&orte_finalize_lock)) {
|
||||
if (opal_atomic_trylock(&orte_finalize_lock)) {
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ void orte_jobs_complete(void)
|
||||
{
|
||||
#if !ORTE_DISABLE_FULL_SUPPORT
|
||||
/* check one-time lock to protect against multiple calls */
|
||||
if (!opal_atomic_trylock(&orte_jobs_complete_lock)) { /* returns 1 if already locked */
|
||||
if (opal_atomic_trylock(&orte_jobs_complete_lock)) { /* returns 1 if already locked */
|
||||
return;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ void orte_jobs_complete(void)
|
||||
void orte_quit(void)
|
||||
{
|
||||
/* check one-time lock to protect against "bounce" */
|
||||
if (!opal_atomic_trylock(&orte_quit_lock)) { /* returns 1 if already locked */
|
||||
if (opal_atomic_trylock(&orte_quit_lock)) { /* returns 1 if already locked */
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -538,7 +538,7 @@ void orte_trigger_event(orte_trigger_event_t *trig)
|
||||
/* if we already fired it, don't do it again - this automatically
|
||||
* records that we did fire it
|
||||
*/
|
||||
if (!opal_atomic_trylock(&trig->lock)) { /* returns 1 if already locked */
|
||||
if (opal_atomic_trylock(&trig->lock)) { /* returns 1 if already locked */
|
||||
return;
|
||||
}
|
||||
|
||||
@ -842,7 +842,7 @@ void orte_trigger_event(orte_trigger_event_t *trig)
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
trig->name));
|
||||
|
||||
if (!opal_atomic_trylock(&trig->lock)) { /* returns 1 if already locked */
|
||||
if (opal_atomic_trylock(&trig->lock)) { /* returns 1 if already locked */
|
||||
return;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user