CLEANUP: memory: make the fault injection code use the OTHER_LOCK label
The mem_should_fail() function sets a lock while it's building its
messages, and when this was done there was no relevant label available
hence the confusing use of START_LOCK. Now OTHER_LOCK is available for
such use cases, so let's switch to this one instead as START_LOCK is
going to disappear.
diff --git a/src/memory.c b/src/memory.c
index 140671b..6555913 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -594,7 +594,7 @@
else
ret = 0;
}
- HA_SPIN_LOCK(START_LOCK, &mem_fail_lock);
+ HA_SPIN_LOCK(OTHER_LOCK, &mem_fail_lock);
n = snprintf(&mem_fail_str[mem_fail_cur_idx * MEM_FAIL_MAX_CHAR],
MEM_FAIL_MAX_CHAR - 2,
"%d %.18s %d %d", mem_fail_cur_idx, pool->name, ret, tid);
@@ -607,7 +607,7 @@
mem_fail_cur_idx++;
if (mem_fail_cur_idx == MEM_FAIL_MAX_STR)
mem_fail_cur_idx = 0;
- HA_SPIN_UNLOCK(START_LOCK, &mem_fail_lock);
+ HA_SPIN_UNLOCK(OTHER_LOCK, &mem_fail_lock);
return ret;
}