[wpiutil] StructArrayLogEntry: Use the same lock everywhere (#6231)

This commit is contained in:
Thad House
2024-01-15 22:41:31 -08:00
committed by GitHub
parent 97828bd325
commit 5bc942f532

View File

@@ -87,7 +87,7 @@ public final class StructArrayLogEntry<T> extends DataLogEntry {
* @param nelem number of elements
*/
public void reserve(int nelem) {
synchronized (m_buf) {
synchronized (this) {
m_buf.reserve(nelem);
}
}
@@ -121,7 +121,7 @@ public final class StructArrayLogEntry<T> extends DataLogEntry {
* @param timestamp Time stamp (0 to indicate now)
*/
public void append(Collection<T> value, long timestamp) {
synchronized (m_buf) {
synchronized (this) {
ByteBuffer bb = m_buf.writeArray(value);
m_log.appendRaw(m_entry, bb, 0, bb.position(), timestamp);
}