Skip to content

Commit

Permalink
[wpiutil] Rename wpi::CreateSemaphore to wpi::MakeSemaphore
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Turner <[email protected]>
  • Loading branch information
spacey-sooty committed Nov 4, 2024
1 parent fa75636 commit ed54065
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ntcoreffi/src/main/native/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ NT_WaitForListenerQueue
WPI_AllocateString
WPI_AllocateStringArray
WPI_MakeEvent
WPI_CreateSemaphore
WPI_MakeSemaphore
WPI_CreateSignalObject
WPI_DataLog_AppendBoolean
WPI_DataLog_AppendBooleanArray
Expand Down
6 changes: 3 additions & 3 deletions wpiutil/src/main/native/cpp/Synchronization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,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);
}

/*
Expand Down
6 changes: 3 additions & 3 deletions wpiutil/src/main/native/include/wpi/Synchronization.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/**
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit ed54065

Please sign in to comment.