diff --git a/ntcoreffi/src/main/native/symbols.txt b/ntcoreffi/src/main/native/symbols.txt index 210fb07fcf2..58b13fff7fc 100644 --- a/ntcoreffi/src/main/native/symbols.txt +++ b/ntcoreffi/src/main/native/symbols.txt @@ -230,7 +230,7 @@ NT_WaitForListenerQueue WPI_AllocateString WPI_AllocateStringArray WPI_MakeEvent -WPI_CreateSemaphore +WPI_MakeSemaphore WPI_CreateSignalObject WPI_DataLog_AppendBoolean WPI_DataLog_AppendBooleanArray diff --git a/wpiutil/src/main/native/cpp/Synchronization.cpp b/wpiutil/src/main/native/cpp/Synchronization.cpp index a7aca3a2515..681df8f70f1 100644 --- a/wpiutil/src/main/native/cpp/Synchronization.cpp +++ b/wpiutil/src/main/native/cpp/Synchronization.cpp @@ -92,7 +92,7 @@ void wpi::ResetEvent(WPI_EventHandle handle) { ResetSignalObject(handle); } -WPI_SemaphoreHandle wpi::CreateSemaphore(int initialCount, int maximumCount) { +WPI_SemaphoreHandle wpi::MakeSemaphore(int initialCount, int maximumCount) { auto& manager = GetManager(); if (gShutdown) { return {}; @@ -341,8 +341,8 @@ void WPI_ResetEvent(WPI_EventHandle handle) { wpi::ResetEvent(handle); } -WPI_SemaphoreHandle WPI_CreateSemaphore(int initial_count, int maximum_count) { - return wpi::CreateSemaphore(initial_count, maximum_count); +WPI_SemaphoreHandle WPI_MakeSemaphore(int initial_count, int maximum_count) { + return wpi::MakeSemaphore(initial_count, maximum_count); } void WPI_DestroySemaphore(WPI_SemaphoreHandle handle) { diff --git a/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp b/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp index 6ff0eda07a1..e36574f9a75 100644 --- a/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp +++ b/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp @@ -248,7 +248,7 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_util_WPIUtilJNI_createSemaphore (JNIEnv*, jclass, jint initialCount, jint maximumCount) { - return wpi::CreateSemaphore(initialCount, maximumCount); + return wpi::MakeSemaphore(initialCount, maximumCount); } /* diff --git a/wpiutil/src/main/native/include/wpi/Synchronization.h b/wpiutil/src/main/native/include/wpi/Synchronization.h index e0721305c90..9b99209ea49 100644 --- a/wpiutil/src/main/native/include/wpi/Synchronization.h +++ b/wpiutil/src/main/native/include/wpi/Synchronization.h @@ -93,7 +93,7 @@ void ResetEvent(WPI_EventHandle handle); * @param maximumCount maximum value for the semaphore's internal counter * @return Semaphore handle */ -WPI_SemaphoreHandle CreateSemaphore(int initialCount = 0, +WPI_SemaphoreHandle MakeSemaphore(int initialCount = 0, int maximumCount = INT_MAX); /** @@ -321,7 +321,7 @@ class Semaphore final { * @param maximumCount maximum value for the semaphore's internal counter */ explicit Semaphore(int initialCount = 0, int maximumCount = INT_MAX) - : m_handle{CreateSemaphore(initialCount, maximumCount)} {} + : m_handle{MakeSemaphore(initialCount, maximumCount)} {} ~Semaphore() { if (m_handle != 0) { DestroySemaphore(m_handle); @@ -494,7 +494,7 @@ void WPI_ResetEvent(WPI_EventHandle handle); * @param maximum_count maximum value for the semaphore's internal counter * @return Semaphore handle */ -WPI_SemaphoreHandle WPI_CreateSemaphore(int initial_count, int maximum_count); +WPI_SemaphoreHandle WPI_MakeSemaphore(int initial_count, int maximum_count); /** * Destroys a semaphore. Destruction wakes up any waiters.