[wpiutil] Fix Semaphore backing vector usage (#8737)

The wrong backing vector was being used (eventIds).
This commit is contained in:
Peter Johnson
2026-04-10 12:27:52 -07:00
committed by GitHub
parent 21f6bdbc1a
commit 7e86c10a28

View File

@@ -180,7 +180,7 @@ void wpi::util::DestroySemaphore(WPI_SemaphoreHandle handle) {
}
auto& manager = guard.GetManager();
std::scoped_lock lock{manager.mutex};
manager.eventIds.erase(handle & 0xffffff);
manager.semaphoreIds.erase(handle & 0xffffff);
}
bool wpi::util::ReleaseSemaphore(WPI_SemaphoreHandle handle, int releaseCount,
@@ -204,7 +204,7 @@ bool wpi::util::ReleaseSemaphore(WPI_SemaphoreHandle handle, int releaseCount,
return false;
}
auto& state = it->second;
int maxCount = manager.eventIds[index];
int maxCount = manager.semaphoreIds[index];
if (prevCount) {
*prevCount = state.signaled;
}