From 7e86c10a28e69268c793dc02049fecdc0e77558f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 10 Apr 2026 12:27:52 -0700 Subject: [PATCH] [wpiutil] Fix Semaphore backing vector usage (#8737) The wrong backing vector was being used (eventIds). --- wpiutil/src/main/native/cpp/Synchronization.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpiutil/src/main/native/cpp/Synchronization.cpp b/wpiutil/src/main/native/cpp/Synchronization.cpp index 636840154e..1f55e4ba2e 100644 --- a/wpiutil/src/main/native/cpp/Synchronization.cpp +++ b/wpiutil/src/main/native/cpp/Synchronization.cpp @@ -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; }